-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
116 lines (106 loc) · 3.91 KB
/
docker-compose.yaml
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
version: '3'
services:
traefik:
image: traefik:v2.4
restart: unless-stopped
command:
- --api.dashboard=true
# - --log.level=debug
- --accesslog=true
- --providers.file=true
- --providers.file.directory=/traefik/config
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --entrypoints.web.address=:80
- --entrypoints.web.http.redirections.entryPoint.to=websecure
- --entrypoints.web.http.middlewares=cors@file
- --entrypoints.websecure.address=:443
- --entrypoints.websecure.http.middlewares=cors@file
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "./traefik:/traefik"
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.tls=true"
- "traefik.http.routers.traefik.rule=Host(`traefik.${DOMAIN:-achieve.localhost}`)"
environment:
DOMAIN: ${DOMAIN:-achieve.localhost}
db:
image: ghcr.io/hackthemidlands/htm-achievements/postgres:${TAG}
build: ./postgres
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:
- "db_data:/var/lib/postgresql/data"
admin:
image: ghcr.io/hackthemidlands/htm-achievements/admin:${TAG}
build:
context: ./admin
target: prod
labels:
org.opencontainers.image.title: achievements-admin-ui
org.opencontainers.image.source: https://github.com/HackTheMidlands/htm-achievements
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.services.admin.loadbalancer.server.port=80"
- "traefik.http.routers.admin.service=admin"
- "traefik.http.routers.admin.rule=Host(`${DOMAIN:-achieve.localhost}`) && PathPrefix(`/admin`)"
- "traefik.http.routers.admin.priority=100"
- "traefik.http.routers.admin.middlewares=admin-prefix@file"
- "traefik.http.routers.admin.tls=true"
web:
image: ghcr.io/hackthemidlands/htm-achievements/web:${TAG}
build:
context: ./web
target: prod
args:
REACT_APP_HOST: ${DOMAIN:-achieve.localhost}
labels:
org.opencontainers.image.title: achievements-ui
org.opencontainers.image.source: https://github.com/HackTheMidlands/htm-achievements
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.services.web.loadbalancer.server.port=80"
- "traefik.http.routers.web.service=web"
- "traefik.http.routers.web.rule=Host(`${DOMAIN:-achieve.localhost}`)"
- "traefik.http.routers.web.tls=true"
api:
image: ghcr.io/hackthemidlands/htm-achievements/api:${TAG}
build:
context: ./api
target: prod
labels:
org.opencontainers.image.title: achievements-api
org.opencontainers.image.source: https://github.com/HackTheMidlands/htm-achievements
restart: unless-stopped
depends_on:
db:
condition: service_healthy
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.tls=true"
- "traefik.http.routers.api.rule=Host(`${DOMAIN:-achieve.localhost}`) && PathPrefix(`/api`)"
- "traefik.http.routers.api.middlewares=api-prefix@file"
environment:
DOMAIN: "${DOMAIN:-achieve.localhost}"
DATABASE_URL: "postgresql://${API_DB_USERNAME}:${API_DB_PASSWORD}@db/api"
ADMIN_LIST: "${ADMIN_LIST}"
SESSION_SECRET: "${SESSION_SECRET}"
DISCORD_OAUTH_CLIENT_ID: "${DISCORD_OAUTH_CLIENT_ID}"
DISCORD_OAUTH_CLIENT_SECRET: "${DISCORD_OAUTH_CLIENT_SECRET}"
TWITTER_OAUTH_CLIENT_ID: "${TWITTER_OAUTH_CLIENT_ID}"
TWITTER_OAUTH_CLIENT_SECRET: "${TWITTER_OAUTH_CLIENT_SECRET}"
EXTERNAL_API_TOKEN: "${EXTERNAL_API_TOKEN}"
volumes:
db_data: