forked from polis-digifinland/polis-digifinland
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
175 lines (167 loc) · 4.59 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
164
165
166
167
168
169
170
171
172
173
174
175
# Before running docker compose up for the first time,
# first copy the env.example file to .env and fill in the values.
# `cp env.example digifinland-dev.env`
# (edit values as needed)
#
# Then, build and run with:
# `docker compose build`
# `docker compose up`
#
# Subsequently you should only need to run:
# `docker compose up`
#
# Force a full re-build with no cache from previous builds:
# `docker compose build --no-cache`
# `docker compose up`
#
# If you only changed the .env file, you can do a quick rebuild:
# `docker compose up --force-recreate`
#
# To stop, press CTRL+C (if not running in --detach mode), or run:
# `docker compose down`
services:
server:
env_file: .env
image: docker.io/compdem/polis-server:${DOCKER_ENV:-dev}
build:
context: ./polis/server
dockerfile: Dockerfile
labels:
polis_tag: ${DOCKER_ENV:-dev}
depends_on:
- "postgres"
- "file-server"
networks:
- "polis-net"
extra_hosts:
- "host.docker.internal:host-gateway"
restart: on-failure
ports:
- 5000:5000
# if needed, comment out above port mapping and uncomment following to expose ports 5000-5005
# this was needed for VM based setup to allow usage of external nginx as load balancer.
# - target: 5000
# published: 5000-5005
# protocol: tcp
# mode: ingress
deploy:
mode: replicated
replicas: 1
endpoint_mode: vip
update_config:
parallelism: 1
delay: 10s
order: stop-first
restart_policy:
condition: always
delay: 5s
# max_attempts: 3
window: 120s
math:
container_name: polis-math
image: docker.io/compdem/polis-math:${DOCKER_ENV:-dev}
depends_on:
- "postgres"
build:
context: ./polis/math
labels:
polis_tag: ${DOCKER_ENV:-dev}
environment:
- DATABASE_URL=${DATABASE_URL:?error}
- MATH_ENV=${MATH_ENV:-dev}
- WEBSERVER_USERNAME=${WEBSERVER_USERNAME:?error}
- WEBSERVER_PASS=${WEBSERVER_PASS:?error}
networks:
- "polis-net"
extra_hosts:
- "host.docker.internal:host-gateway"
deploy:
restart_policy:
condition: always
delay: 5s
# max_attempts: 3
window: 120s
# postgres:
# container_name: polis-postgres
# env_file: ./polis/server/docker-db-dev.env
# image: docker.io/compdem/polis-postgres:${TAG}
# restart: always
# build:
# context: ./server
# dockerfile: Dockerfile-db
# networks:
# - "polis-net"
# volumes:
# - "backups:/backups"
# - "postgres:/var/lib/postgresql/data"
postgres:
image: docker.io/compdem/polis-postgres:${TAG:-dev}
restart: always
build:
context: ./polis/server
dockerfile: Dockerfile-db
labels:
polis_tag: ${TAG:-dev}
environment:
- POSTGRES_DB=${POSTGRES_DB:?error}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?error}
- POSTGRES_USER=${POSTGRES_USER:?error}
networks:
- "polis-net"
ports:
- ${POSTGRES_PORT:-5432}:${POSTGRES_PORT:-5432}
volumes:
- "backups:/backups"
- "postgres:/var/lib/postgresql/data"
# nginx-proxy:
polis.local:
container_name: polis-nginx-proxy
image: docker.io/compdem/polis-nginx-proxy:${TAG}
build:
context: ./polis/file-server
dockerfile: nginx.Dockerfile
environment:
- TAG
depends_on:
- "server"
restart: unless-stopped
networks:
- "polis-net"
ports:
- ${HTTP_PORT:-80}:${HTTP_PORT:-80}
- ${HTTPS_PORT:-443}:${HTTPS_PORT:-443}
file-server:
# container_name: polis-file-server
image: docker.io/compdem/polis-file-server:${DOCKER_ENV:-dev}
build:
context: ./polis/
dockerfile: file-server/Dockerfile
labels:
polis_tag: ${DOCKER_ENV:-dev}
args:
GIT_HASH: "${GIT_HASH:-placeholder}"
SERVICE_URL: ${SERVICE_URL}
environment:
- EMBED_SERVICE_HOSTNAME=${EMBED_SERVICE_HOSTNAME}
#- FB_APP_ID=${FB_APP_ID}
- PORT=${STATIC_FILES_PORT:-8080}
- REPORT_UPLOADER=${REPORT_UPLOADER:-local}
#- SERVICE_URL=${SERVICE_URL}
#- REPORT_SERVICE_URL=${REPORT_SERVICE_URL}
- S3_BUCKET_PREPROD=${S3_BUCKET_PREPROD}
- S3_BUCKET_PROD=${S3_BUCKET_PROD}
- SCP_SUBDIR_PREPROD=${SCP_SUBDIR_PREPROD}
- SCP_SUBDIR_PROD=${SCP_SUBDIR_PROD}
networks:
- "polis-net"
deploy:
restart_policy:
condition: always
delay: 5s
# max_attempts: 3
window: 120s
networks:
polis-net:
volumes:
backups:
postgres: