-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
90 lines (85 loc) · 2.83 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
version: "3"
services:
survey-frontend:
build:
context: ./01-survey-app
dockerfile: Dockerfile
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.survey-frontend.entrypoints=https"
- "traefik.http.routers.survey-frontend.rule=Host(`studie.mydomain.de`)"
- "traefik.http.routers.survey-frontend.tls=true"
- "traefik.http.routers.survey-frontend.tls.certresolver=lets-encr"
- "traefik.http.routers.survey-frontend.middlewares=redirect-www@file"
networks:
- proxy
survey-database:
image: postgres:10.4
volumes:
- ./postgresdata:/var/lib/postgresql/data
- ./survey-backend/config/01-dbinit.sql:/docker-entrypoint-initdb.d/01-dbinit.sql
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: cut-simulation-survey
networks:
- survey-api
survey-external-backend:
build:
context: ./02-survey-backend
dockerfile: Dockerfile
restart: always
depends_on:
- "survey-database"
environment:
DB_HOST: survey-database
DB_NAME: cut-simulation-survey
DB_USER: postgres
DB_PASS: password
DB_PORT: 5432
DB_MAX_CONNECTIONS: 10
API_VARIANT: external
API_CORS_ORIGINS: https://studie.mydomain.de
labels:
- "traefik.enable=true"
- "traefik.http.routers.survey-external-backend.rule=Host(`studie-api.mydomain.de`)"
- "traefik.http.routers.survey-external-backend.entrypoints=https"
- "traefik.http.routers.survey-external-backend.tls=true"
- "traefik.http.routers.survey-external-backend.tls.certresolver=lets-encr"
networks:
- proxy
- survey-api
survey-internal-backend:
build:
context: ./02-survey-backend
dockerfile: Dockerfile
restart: always
depends_on:
- "survey-database"
environment:
DB_HOST: survey-database
DB_NAME: cut-simulation-survey
DB_USER: postgres
DB_PASS: password
DB_PORT: 5432
DB_MAX_CONNECTIONS: 10
API_VARIANT: internal
API_CORS_ORIGINS: https://studie.mydomain.de
labels:
- "traefik.enable=true"
- "traefik.http.routers.survey-internal-backend.entrypoints=https"
- "traefik.http.routers.survey-internal-backend.rule=Host(`studie-auswertung.mydomain.de`)"
- "traefik.http.routers.survey-internal-backend.tls=true"
- "traefik.http.routers.survey-internal-backend.tls.certresolver=lets-encr"
- "traefik.http.middlewares.survey-authenticator.basicauth.users=survey:passwordhash"
- "traefik.http.routers.survey-internal-backend.middlewares=survey-authenticator@docker"
networks:
- proxy
- survey-api
networks:
proxy:
external: true
survey-api:
external: true