Skip to content

Commit

Permalink
fix: Fixed docker compose specification with extends and depends_on
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Mar 7, 2024
1 parent 35dfe45 commit aefde96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
16 changes: 3 additions & 13 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ services:
- "com.centurylinklabs.watchtower.enable=true"
- "com.centurylinklabs.watchtower.depends-on=/skeleton-app-1"

app:
app: &app_template
image: my-registry/roadiz_skeleton:latest
restart: always
depends_on:
Expand Down Expand Up @@ -145,26 +145,16 @@ services:
- "com.centurylinklabs.watchtower.depends-on=/skeleton-redis-1"

worker:
extends:
service: app
<<: *app_template
deploy:
# Do not use more than 1 replica if you're using Varnish and need to purge/ban cache
# from your workers. Varnish ACL hostnames won't be resolved correctly.
replicas: 1
entrypoint: [ "php", "/var/www/html/bin/console", "messenger:consume", "async", "--time-limit=1800" ]
restart: always
labels:
- "com.centurylinklabs.watchtower.enable=true"
- "com.centurylinklabs.watchtower.depends-on=/skeleton-redis-1"

cron:
extends:
service: app
<<: *app_template
entrypoint: 'docker-cron-entrypoint'
restart: always
labels:
- "com.centurylinklabs.watchtower.enable=true"
- "com.centurylinklabs.watchtower.depends-on=/skeleton-redis-1"

#solr:
# image: my-registry/roadiz_skeleton/solr:latest
Expand Down
8 changes: 3 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ services:
- "traefik.http.routers.${APP_NAMESPACE}_pma_secure.rule=Host(${HOSTNAME_PMA})"
- "traefik.http.routers.${APP_NAMESPACE}_pma_secure.service=${APP_NAMESPACE}_pma"

app:
app: &app_template
# Need to pass all vars to docker env for Crontab and supervisor scripts
#env_file: "./.env.local"
build:
Expand Down Expand Up @@ -113,8 +113,7 @@ services:
# - "traefik.http.routers.${APP_NAMESPACE}_secure.service=${APP_NAMESPACE}"

worker:
extends:
service: app
<<: *app_template
deploy:
# Do not use more than 1 replica if you're using Varnish and need to purge/ban cache
# from your workers. Varnish ACL hostnames won't be resolved correctly.
Expand All @@ -123,8 +122,7 @@ services:
restart: unless-stopped

cron:
extends:
service: app
<<: *app_template
# https://github.com/dubiousjim/dcron/issues/13#issuecomment-1406937781
init: true
entrypoint: [ "crond", "-f", "-L", "15" ]
Expand Down

0 comments on commit aefde96

Please sign in to comment.