-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yaml
166 lines (159 loc) · 3.58 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
services:
####################### Database #######################
database:
image: hsb:database
restart: "no"
container_name: hsb-database
profiles:
- all
- main
build:
context: database
env_file:
- database/.env
ports:
- ${DATABASE_PORT:-30000}:5432
volumes:
- hsb-database:/var/lib/postgresql/data
networks:
- hsb
####################### Keycloak #######################
keycloak:
image: hsb:keycloak
restart: "no"
container_name: hsb-keycloak
profiles:
- all
- main
- auth
build:
context: ./keycloak
env_file:
- keycloak/.env
volumes:
- ./keycloak/config:/opt/keycloak/data/import
ports:
- ${KEYCLOAK_HTTP_PORT:-30001}:8080
- ${KEYCLOAK_HTTPS_PORT:-30002}:443
depends_on:
- database
networks:
- hsb
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: curl -s -f http://localhost:8080/realms/hsb || exit 1
interval: 5m
timeout: 15s
retries: 3
start_period: 1m
####################### CSS API #######################
css:
image: hsb:css
restart: "no"
container_name: hsb-css
profiles:
- all
- main
- auth
build:
context: ./
dockerfile: src/api-css/Dockerfile
env_file: src/api-css/.env
ports:
- ${CSS_HTTP_PORT:-30003}:8080
- ${CSS_HTTPS_PORT:-30004}:443
extra_hosts:
- host.docker.internal:host-gateway
depends_on:
- database
- keycloak
networks:
- hsb
####################### API #######################
api:
image: hsb:api
restart: "no"
container_name: hsb-api
profiles:
- all
- main
build:
context: ./
dockerfile: src/api/Dockerfile
env_file: src/api/.env
ports:
- ${API_HTTP_PORT:-30005}:8080
- ${API_HTTPS_PORT:-30006}:443
extra_hosts:
- host.docker.internal:host-gateway
depends_on:
- database
- keycloak
networks:
- hsb
healthcheck:
test: curl -s -f http://localhost:8080/v1/health
interval: 5m
timeout: 30s
retries: 3
start_period: 2m
####################### App #######################
app:
image: hsb:app
stdin_open: true
tty: true
restart: "no"
container_name: hsb-app
profiles:
- all
- main
build:
context: src/dashboard
dockerfile: Dockerfile
env_file: src/dashboard/.env
ports:
- ${APP_HTTP_PORT:-30080}:3000
- ${APP_HTTPS_PORT:-30443}:3443
volumes:
- ./src/dashboard/src:/usr/dashboard/src
- ./src/dashboard/public:/usr/dashboard/public
extra_hosts:
- host.docker.internal:host-gateway
# depends_on:
# - api
networks:
- hsb
healthcheck:
test: curl -s -f http://localhost:3000/api/health
interval: 5m
timeout: 30s
retries: 3
start_period: 2m
####################### Nginx #######################
nginx:
image: hsb:nginx
restart: "no"
container_name: hsb-nginx
profiles:
- all
- maintenance
build:
context: nginx
env_file:
- nginx/.env
ports:
- ${NGINX_HTTP_PORT:-30007}:80
- ${NGINX_HTTPS_PORT:-30008}:443
extra_hosts:
- host.docker.internal:host-gateway
networks:
- hsb
####################### Volumes Definition #######################
volumes:
hsb-database:
name: hsb-database
####################### Networks Definition #######################
networks:
hsb:
driver: bridge