-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.yml
72 lines (67 loc) · 1.55 KB
/
base.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
62
63
64
65
66
67
68
69
70
71
72
# Base compose file used by docker-compose.yml & production.yml
version: "2"
services:
learning:
restart: always
build: ./learning
networks:
main:
aliases:
- learning
expose:
- "8000"
command: ["gunicorn", "webservice.main:app", "-w", "4", "-b", ":8000", "--timeout", "60"]
# Django server
server:
restart: always
build: ./server
networks:
main:
aliases:
- server
expose:
- "8000"
volumes:
# Volume for generated files
# Shared w/ ui container so nginx can serve files
- media:/www/media
# Volume for Django static assets
# Shared w/ ui container so nginx can serve files
- static:/www/server
env_file: .env
command: ["/usr/src/app/launch_server.sh"]
# Container running Nginx and serving React app
ui:
restart: always
build: ./ui
networks:
main:
aliases:
- ui
ports:
- "${NGINX_PORT}:80"
volumes:
- media:/www/media
- static:/www/server
# Postgres DB container
db:
image: postgres:12-alpine
restart: always
networks:
main:
aliases:
- db
volumes:
- pgdata:/var/lib/postgresql/data/
env_file: .env
# Set log_min_duration_statement so any commands over 500ms are logged
command: ["postgres",
"-c", "log_min_duration_statement=500",
"-c", "shared_buffers=${PG_SHARED_BUFFERS}",
"-c", "effective_cache_size=${PG_EFFECTIVE_CACHE_SIZE}"]
volumes:
media:
pgdata:
static:
networks:
main: