This repository was archived by the owner on Nov 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.dev.yml
93 lines (83 loc) · 3.19 KB
/
docker-compose.dev.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
version: "3.3"
services:
traefik:
container_name: traefik
image: traefik:latest
privileged: true
depends_on:
- politicry-api
- politicry-db
- politicry-frontend
command:
- --api.insecure=true
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --providers.file.filename=/etc/traefik/traefik-dynamic.yml
- --entrypoints.web.address=:80
ports:
- ${APP_PORT:-3000}:80
- 127.0.0.1:9091:8080
volumes:
- ./letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik-dynamic.dev.yml:/etc/traefik/traefik-dynamic.yml
politicry-frontend:
container_name: politicry-frontend
build:
context: ./website
restart: always
depends_on:
- politicry-api
environment:
- PORT=3000
- HOST=0.0.0.0
- BASE_URL=http://api:3000/
- BROWSER_BASE_URL=http://${APP_HOST:-localhost}:${APP_PORT:-3000}
labels:
- traefik.enable=true
- traefik.http.routers.politicry-frontend.rule=Host(`${APP_HOST:-localhost}`)
- traefik.http.routers.politicry-frontend.entrypoints=web
- traefik.http.routers.politicry-frontend.middlewares=security-headers@file
# Also allow https
- traefik.http.routers.politicry-frontendTLS.rule=Host(`${APP_HOST:-localhost}`)
- traefik.http.routers.politicry-frontendTLS.entrypoints=web
- traefik.http.routers.politicry-frontendTLS.middlewares=security-headers@file
- traefik.http.routers.politicry-frontendTLS.tls=true
- traefik.http.services.politicry-frontend.loadBalancer.server.port=3000 # required because build can take a while on start
volumes:
- ./website:/app:z
politicry-api:
container_name: politicry-api
restart: unless-stopped
build: ./backend
depends_on:
- politicry-db
environment:
- PORT=3000
- HOST=0.0.0.0
- DB_PASSWORD=politicry
- DATABASE_URL=postgresql://politicry:politicry@politicry-db:5432/politicry
- BROWSER_BASE_URL=https://${APP_HOST:-localhost}:${APP_PORT:-3000}
- SECRET_KEY=politicry
labels:
- traefik.enable=true
- traefik.http.routers.politicry-api.rule=Host(`${APP_HOST:-localhost}`)
- traefik.http.routers.politicry-api.entrypoints=web
- traefik.http.routers.politicry-api.middlewares=security-headers@file, api-headers@file
- traefik.http.services.politicry-api.loadBalancer.server.port=3000 # required because build can take a while on start
# Also allow https
- traefik.http.routers.politicry-apiTLS.rule=Host(`${APP_HOST:-localhost}`)
- traefik.http.routers.politicry-apiTLS.entrypoints=web
- traefik.http.routers.politicry-apiTLS.middlewares=security-headers@file, api-headers@file
- traefik.http.routers.politicry-apiTLS.tls=true
# For production use, it's better to have a separate database container running postgres, instead of sqlite
politicry-db:
container_name: politicry-db
image: postgres:alpine
restart: always
environment:
- POSTGRES_DB=politicry
- POSTGRES_USER=politicry
- POSTGRES_PASSWORD=politicry
volumes:
- ./politicry-pgdata:/var/lib/postgresql/data