I have developed a Shopify custom app that is built using the Shopify PHP Template
[GitHub - Shopify/shopify-app-template-php](https://PHP SHOIPFY TEMPLATE)
In that app, I have a cron task that is working fine locally by running an artisan command
php artisan schedule: work
and it does successfully run the task. However, I am having difficulties when I deploy it to Fly.io as Shopify recommends using fly.io.
When I run the command flyctl launch
it gives me the following Dockerfile and I have no idea how to set up a cron/scheduled task for my project.
FROM php:8.1-fpm-alpine
ARG SHOPIFY_API_KEY
ENV SHOPIFY_API_KEY=$SHOPIFY_API_KEY
RUN apk update && apk add --update nodejs npm \
composer php-pdo_sqlite php-pdo_mysql php-pdo_pgsql php-simplexml php-fileinfo php-dom php-tokenizer php-xml php-xmlwriter php-session \
openrc bash nginx
RUN docker-php-ext-install pdo
COPY --chown=www-data:www-data web /app
WORKDIR /app
# Overwrite default nginx config
COPY web/nginx.conf /etc/nginx/nginx.conf
# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
RUN composer install
RUN touch /app/storage/db.sqlite
RUN chown www-data:www-data /app/storage/db.sqlite
RUN cd frontend && npm install && npm run build
RUN composer build
ENTRYPOINT [ "/app/entrypoint.sh" ]