-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
74 lines (71 loc) · 2.22 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
74 lines (71 loc) · 2.22 KB
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
services:
db:
container_name: cc_db
# image: timescale/timescaledb:latest-pg15
build: ./timescale
restart: unless-stopped
environment:
POSTGRES_USER: "${DB_USERNAME}"
POSTGRES_PASSWORD: "${DB_PASSWORD}"
API_DB: "api"
API_DB_USER: "${API_DB_USERNAME}"
API_DB_PASSWORD: "${API_DB_PASSWORD}"
volumes:
- "./data/timescaledb:/var/lib/postgresql/data"
- ./timescale:/docker-entrypoint-initdb.d
networks:
- internal_network
web:
build:
context: ./web
target: prod
args:
REACT_APP_HOST: ${DOMAIN:-cyclecounter.co.uk}
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.services.cc_web.loadbalancer.server.port=80"
- "traefik.http.routers.cc_web.tls.certresolver=letsEncrypt"
- "traefik.http.routers.cc_web.rule=Host(`${DOMAIN:-cyclecounter.localhost}`)"
- "traefik.http.routers.cc_web.tls=true"
networks:
- traefik_web
api:
build:
context: ./api
target: prod
restart: unless-stopped
depends_on:
db:
condition: service_healthy
labels:
- "traefik.enable=true"
- "traefik.http.routers.cc_api.tls=true"
- "traefik.http.routers.cc_api.tls.certresolver=letsEncrypt"
- "traefik.http.services.cc_api.loadbalancer.server.port=80"
- "traefik.http.routers.cc_api.rule=Host(`${DOMAIN:-cyclecounter.localhost}`) && PathPrefix(`/api`)"
- "traefik.http.middlewares.strip_api.stripprefix.prefixes=/api"
- "traefik.http.routers.cc_api.middlewares=strip_api"
environment:
# Job outcomes and scheduler decisions are reported through the log, so
# do not let them sit in a buffer.
PYTHONUNBUFFERED: "1"
DOMAIN: "${DOMAIN:-cyclecounter.localhost}"
DATABASE_URL: "postgresql://${API_DB_USERNAME}:${API_DB_PASSWORD}@cc_db/api"
SESSION_SECRET: "${SESSION_SECRET}"
VIVACITY_KEY: "${VIVACITY_KEY}"
EXTERNAL_API_TOKEN: "${EXTERNAL_API_TOKEN}"
networks:
- internal_network
- traefik_web
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
networks:
traefik_web:
external:
true
internal_network:
internal: true