I'm very new to Docker.
I dockerized my Laravel application.
This is the base image php:8.1.2-apache
At the end of Dockerfile I'm using my own entrypoint script
ENTRYPOINT ["/usr/local/bin/start"]
This script (/usr/local/bin/start) contains few commands like
composer install --no-interaction &&
php artisan config:cache &&
php artisan route:cache &&
php artisan view:cache &&
php artisan storage:link
Now I'm using this Docker Image for many things like laravel scheduler, queue etc...
What I want to do is to extend the entrypoint script from docker-compose file, so that whenever the containers get started the entrypoint script gets executed first then finally the main command which will be passing from docker-compose will be executed.
Something like:
laravel-scheduler:
image: laravel
container_name: laravel-scheduler
restart: always
volumes:
- .:/var/www/html
command: php artisan schedule:work