forked from compdemocracy/polis
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
163 lines (145 loc) · 3.4 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# @TTD: sort networks/volumes consistently (network first)
# before running docker-compose up for the first time,
# either do a pull:
# docker-compose pull
# or do a build:
# GIT_HASH $(git rev-parse --short HEAD) docker-compose up --detach
# subsequently you should only need to run:
# docker-compose up --detach
# force a full re-build with no cache from previous builds:
# docker-compose build --build-arg GIT_HASH $(git rev-parse --short HEAD) --parallel --no-cache
# to stop:
# docker-compose down
## TODO: add config container
version: "3.1"
services:
server:
container_name: polis-server
env_file: ./server/docker-dev.env
environment:
- POLIS_ROOT=/app/
image: compdem/polis-server:${TAG}
build:
context: ./server
dockerfile: Dockerfile
depends_on:
- "postgres"
- "file-server"
networks:
- "polis-net"
volumes:
- "config:/app/config"
ports:
- "5000:5000"
- "9229:9229"
math:
container_name: polis-math
env_file: ./math/docker-dev.env
image: compdem/polis-math:${TAG}
depends_on:
- "postgres"
build:
context: ./math
volumes:
- "config:/config"
networks:
- "polis-net"
postgres:
container_name: polis-postgres
env_file: ./server/docker-db-dev.env
image: compdem/polis-postgres:${TAG}
depends_on:
- "config"
restart: always
build:
context: ./server
dockerfile: Dockerfile-db
networks:
- "polis-net"
volumes:
- "backups:/backups"
- "config:/config"
- "postgres:/var/lib/postgresql/data"
nginx-proxy:
container_name: polis-nginx-proxy
image: compdem/polis-nginx-proxy:${TAG}
build:
context: ./file-server
dockerfile: nginx.Dockerfile
environment:
- TAG
depends_on:
- "server"
networks:
- "polis-net"
volumes:
- "config:/config"
ports:
- "80:80"
- "443:443"
file-server:
container_name: polis-file-server
image: compdem/polis-file-server:${TAG}
build:
context: ./file-server
dockerfile: Dockerfile
depends_on:
- "client-participation"
- "client-admin"
- "client-report"
networks:
- "polis-net"
volumes:
- "config:/config"
ports:
- "8080:8080"
client-participation:
container_name: polis-client-participation
image: compdem/polis-client-participation:${TAG}
depends_on:
- "config"
build:
context: ./client-participation
args:
GIT_HASH: "${GIT_HASH}"
client-admin:
container_name: polis-client-admin
image: compdem/polis-client-admin:${TAG}
depends_on:
- "config"
build:
context: ./client-admin
args:
GIT_HASH: "${GIT_HASH}"
client-report:
container_name: polis-client-report
image: compdem/polis-client-report:${TAG}
depends_on:
- "config"
build:
context: ./client-report
args:
GIT_HASH: "${GIT_HASH}"
maildev:
image: maildev/maildev:1.1.0
networks:
- "polis-net"
ports:
# User interface
- "1080:80"
# SMTP port
- "25:25"
config:
build:
context: ./config
dockerfile: Dockerfile
volumes:
- "config:/config"
networks:
polis-net:
volumes:
backups:
postgres:
config:
# We hardcode this machine name so it won't vary depending on git dir name.
name: polis_config