-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
60 lines (60 loc) · 1.48 KB
/
docker-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
version: "3.3"
x-db-env: &dbenv
MYSQL_PASSWORD: "CHANGE_ME_4_MORE_SECURITY"
x-api-env: &apienv
SU_PASSWORD: "CHANGE_ME_4_MORE_SECURITY"
services:
init-jwt-certs:
build: ressources/jwt_certs
image: init-jwt-certs:latest
container_name: init-jwt-certs
volumes:
- ./ressources/jwt_certs/generate_certs.sh:/tmp/generate_certs.sh:z
- certs-data:/certs
api-users:
build: ./
image: api-users:latest
container_name: api-users
restart: on-failure
ports:
- "8080:8080"
- "8081:8081"
healthcheck:
test: curl --fail http://localhost:8080/status || exit 1
interval: 5s
retries: 20
start_period: 5s
timeout: 1s
volumes:
- ./ressources/compose-config.yml:/home/appli/config.yml
- ./ressources/rbac:/rbac
- certs-data:/certs
environment:
<<: *dbenv
<<: *apienv
entrypoint: ["/home/appli/server", "-c", "/home/appli/config.yml"]
depends_on:
mariadb:
condition: service_healthy
mariadb:
image: 'mariadb:latest'
container_name: mariadb
restart: on-failure
environment:
MYSQL_USER: appli
MYSQL_DATABASE: api-users
MARIADB_RANDOM_ROOT_PASSWORD: "true"
<<: *dbenv
ports:
- "3306:3306"
volumes:
- mysql-data:/var/lib/mysql/
healthcheck:
test: ["CMD", "mysqladmin", "ping", "--silent"]
interval: 5s
retries: 20
start_period: 5s
timeout: 1s
volumes:
mysql-data:
certs-data: