-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
75 lines (69 loc) · 1.6 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#####
# Docker compose YAML file
#
# For documentation see: https://docs.docker.com/compose/yml/
#####
version: "3"
volumes:
static-files:
driver: local
media-files:
driver: local
postgres:
driver: local
db-backups:
driver: local
webapp-backups:
driver: local
networks:
backend:
frontend:
services:
db:
image: postgres:11
volumes:
- postgres:/var/lib/postgresql/data/pgdata
- db-backups:/srv/db-backups
- ./db:/srv/db
networks:
- backend
env_file:
- ./environment/.env
webserver:
image: nginx:1.15
ports:
- "80:80"
- "443:443"
depends_on:
- webapp
volumes:
- ./webserver/nginx.tmpl:/etc/nginx/conf.d/nginx.tmpl
- ./webserver/localhost.crt:/etc/ssl/certs/localhost.crt
- ./webserver/localhost.key:/etc/ssl/private/localhost.key
- static-files:/srv/static-files
- media-files:/srv/media-files
networks:
- frontend
env_file:
- ./environment/.env
command: /bin/sh -c "envsubst < /etc/nginx/conf.d/nginx.tmpl > /etc/nginx/nginx.conf && exec nginx -g 'daemon off;'"
webapp:
build:
context: webapp
volumes:
- ./webapp:/srv/myproject
- static-files:/srv/static-files
- media-files:/srv/media-files
- webapp-backups:/srv/webapp-backups
networks:
- backend
- frontend
expose:
- "3031"
ports:
- "8000:8000"
- "8001:8001"
depends_on:
- db
env_file:
- ./environment/.env