Skip to content

Commit

Permalink
add a restart policy so containers are restarted automatically on reb…
Browse files Browse the repository at this point in the history
…oot (#771)
  • Loading branch information
takinbo authored Nov 10, 2020
1 parent fbf8f85 commit f7d6b05
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: "3"

services:
postgres:
restart: always
build:
context: ./postgis
environment:
Expand All @@ -11,15 +12,19 @@ services:
- postgres_data:/var/lib/postgresql/data

redis:
restart: always
image: redis:4-alpine

web:
restart: always
build: .
links:
- postgres
- redis
environment:
DATABASE_NAME: ${DATABASE_NAME:-apollo}
env_file:
- ./.env
volumes:
- upload_data:/app/uploads
- ./settings.ini:/app/settings.ini
Expand All @@ -28,12 +33,15 @@ services:
command: ['./wait-for-it.sh', 'postgres:5432', '--', './manage.py', 'gunicorn', '-c', 'gunicorn.conf']

worker:
restart: always
build: .
links:
- postgres
- redis
environment:
DATABASE_NAME: ${DATABASE_NAME:-apollo}
env_file:
- ./.env
volumes:
- upload_data:/app/uploads
- ./settings.ini:/app/settings.ini
Expand Down

0 comments on commit f7d6b05

Please sign in to comment.