Created
December 15, 2020 16:09
-
-
Save igortrinidad/9e590af0e43e57fa56750814d5e805e9 to your computer and use it in GitHub Desktop.
Nginx not restarting with docker compose daemon
This file contains hidden or 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" | |
services: | |
app: | |
build: . | |
container_name: cee_app | |
ports: | |
- "3333:3333" | |
environment: | |
HOST: '0.0.0.0' | |
DB_HOST: db | |
REDIS_HOST: redis | |
volumes: | |
- .:/app | |
networks: | |
- network_cee | |
db: | |
container_name: cee_pg | |
image: postgres | |
restart: always | |
ports: | |
- "5432:5432" | |
volumes: | |
- ./docker-volumes/postgres:/var/lib/postgresql/data | |
environment: | |
POSTGRES_DB: *** | |
POSTGRES_PASSWORD: **** | |
networks: | |
- network_cee | |
redis: | |
container_name: cee_redis | |
image: redis | |
restart: always | |
ports: | |
- "6379:6379" | |
networks: | |
- network_cee | |
nginx: | |
container_name: cee_nginx | |
image: nginx | |
restart: always | |
volumes: | |
- ./docker-volumes/nginx:/etc/nginx/conf.d | |
- ./docker-volumes/certbot/conf:/etc/letsencrypt | |
- ./docker-volumes/certbot/www:/var/www/certbot | |
- ./docker-volumes/log/nginx:/var/log/nginx | |
ports: | |
- "80:80" | |
- "443:443" | |
networks: | |
- network_cee | |
depends_on: | |
- app | |
- db | |
- redis | |
- certbot | |
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'" | |
certbot: | |
container_name: cee_certbot | |
image: certbot/certbot | |
restart: always | |
volumes: | |
- ./docker-volumes/certbot/conf:/etc/letsencrypt | |
- ./docker-volumes/certbot/www:/var/www/certbot | |
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" | |
networks: | |
network_cee: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment