-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
62 lines (49 loc) · 1.15 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
version: '3.8'
services:
django:
build: .
container_name: web
restart: always
command: sh -c "python manage.py collectstatic --noinput && python manage.py makemigrations && python manage.py migrate && gunicorn app.wsgi:application -b 0.0.0.0:8000"
env_file:
- .env
volumes:
- ./app:/app
- /app/static:/static
expose:
- "8000"
depends_on:
db:
condition: service_healthy
nginx:
image: nginx:stable-alpine
container_name: nginx
restart: unless-stopped
volumes:
- ./app:/app
- ./nginx:/etc/nginx/conf.d
- /app/static:/static
ports:
- "8000:8000"
depends_on:
- django
db:
image: postgres:13
container_name: postgresdjango
restart: always
env_file:
- .env
environment:
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: $POSTGRES_NAME
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: pg_isready -U $POSTGRES_USER
interval: 2s
timeout: 3s
retries: 10
volumes:
postgres-data:
external: true