-
Notifications
You must be signed in to change notification settings - Fork 1
/
compose.yml
127 lines (120 loc) · 2.9 KB
/
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
services:
database:
image: postgres:16-alpine
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
volumes:
- ./database/init:/docker-entrypoint-initdb.d/
- ./database/data:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "postgres"]
interval: 5s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- backend
database-keycloak:
image: postgres:16-alpine
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=keycloak
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "keycloak"]
interval: 5s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- backend
keycloak:
image: keycloak/keycloak:22.0.5
environment:
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=admin
- KC_DB_USERNAME=postgres
- KC_DB_PASSWORD=postgres
- KC_DB_URL_HOST=database-keycloak
volumes:
- ./keycloak/keycloak.conf:/keycloak/keycloak.conf
- ./keycloak/data:/opt/keycloak/data/import
depends_on:
- database-keycloak
command:
["--config-file=/keycloak/keycloak.conf", "start-dev", "--import-realm"]
restart: on-failure
networks:
- backend
- frontend
backend:
build:
context: ./api-server
environment:
- KEYCLOAK_INTERNAL_URL=http://keycloak:8080/
- KEYCLOAK_REALM=CompetitionManager
- KEYCLOAK_EXTERNAL_URL=http://auth.localhost/
- KEYCLOAK_CLIENT_ID=competition-manager-web
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
- POSTGRES_HOST=database
restart: on-failure
depends_on:
- database
- keycloak
networks:
- frontend
- backend
docs:
build:
context: ./docs
ports:
- 4567:4567
environment:
- WEB_SERVER_ADDRESS=backend:8080
volumes:
- ./docs/build:/srv/slate/build
depends_on:
- backend
networks:
- frontend
cdn:
build:
context: ./upload-server
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
- POSTGRES_HOST=database
restart: on-failure
depends_on:
- database
networks:
- frontend
- backend
frontend:
build:
context: ./frontend
ports:
- 80:80
environment:
- DOMAIN=localhost
- PORT=80
- API_URL=http://backend:8080
- KEYCLOAK_URL=http://keycloak:8080
- CDN_URL=http://cdn:8080
- API_SUBDOMAIN=api
- AUTH_SUBDOMAIN=auth
- CDN_SUBDOMAIN=cdn
depends_on:
- backend
- keycloak
networks:
- frontend
networks:
frontend:
backend: