-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·87 lines (80 loc) · 1.92 KB
/
docker-compose.yml
File metadata and controls
executable file
·87 lines (80 loc) · 1.92 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
version: "3.8"
services:
postgres:
image: postgres:latest
container_name: postgres_db
restart: always
environment:
POSTGRES_USER: "${DB_USER}"
POSTGRES_PASSWORD: "${DB_PASS}"
POSTGRES_DB: "${DB_NAME}"
ports:
- "5432:5432"
volumes:
- postgresql-data:/var/lib/postgresql/data
- ./docker/db/init.sql:/docker-entrypoint-initdb.d/init.sql
- .env
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
timeout: 5s
retries: 5
networks:
- chapiana
api:
build: ./
env_file: .env
command: >
bash -c "python wait_for_postgres.py &&
./manage.py migrate &&
./manage.py runserver 0.0.0.0:8000
gunicorn config.wsgi:application --bind 0.0.0.0:8000"
depends_on:
- postgres
- redis
environment:
- DJANGO_SECRET_KEY: "local"
ports:
- "8000:8000"
restart: unless-stopped
volumes:
- static_volume:/opt/chapiana/static
- media_volume:/opt/chapiana/media
networks:
- chapiana
redis:
image: redis:latest
container_name: redis_cache
restart: always
command:
- --loglevel warning
volumes:
- redis-data:/data:Z
ports:
- "6379:6379"
networks:
- chapiana
nginx:
image: nginx:latest
container_name: nginx_proxy
restart: always
build: ./nginx/
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- static_volume:/opt/chapiana/static
- media_volume:/opt/chapiana/media
- ./nginx/ssl:/etc/nginx/ssl
depends_on:
- api
networks:
- chapiana
networks:
chapiana:
driver: bridge
volumes:
postgres_data:
static_volume:
media_volume: