Last active
November 15, 2020 09:01
-
-
Save vchakoshy/fd9314a0f03e2da2eaac96023fc3c900 to your computer and use it in GitHub Desktop.
laravel docker compose and docker swarm with roll out and health check and cron jobs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.4" | |
services: | |
app: | |
image: appimage/master:stable # change me | |
ports: | |
- 8081:80 | |
env_file: | |
- stage-prod.env | |
environment: | |
APACHE_EXTENSION_REMOTEIP: 1 | |
stop_grace_period: 10s | |
healthcheck: | |
test: ["CMD", "curl", "-f", "http://localhost"] | |
interval: 5s | |
timeout: 2s | |
retries: 30 | |
start_period: 5s | |
deploy: | |
replicas: 2 | |
update_config: | |
order: start-first | |
app-cron: | |
image: appimage/master:stable # change me | |
env_file: | |
- stage-prod.env | |
environment: | |
- CRON_USER=docker | |
- CRON_SCHEDULE=* * * * * | |
- CRON_COMMAND=cd /var/www/html && php artisan schedule:run >> /dev/null 2>&1 | |
stop_grace_period: 120s | |
deploy: | |
replicas: 1 | |
update_config: | |
order: start-first | |
delay: 20s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment