-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.default.yml
More file actions
76 lines (75 loc) · 2.25 KB
/
docker-compose.default.yml
File metadata and controls
76 lines (75 loc) · 2.25 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
75
76
services:
db:
image: mysql:8.0
command: --default-authentication-plugin=mysql_native_password
restart: always
volumes:
# Where starting dumps are stored
- ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql
# Where data will be stored
- ./mysql:/var/lib/mysql
# Custom conf for MySQL server
- ./custom.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
expose:
- 3306
ports:
# Mapping here for testing purposes
- 3308:3306
environment:
MYSQL_ROOT_PASSWORD: qsample2022
MYSQL_USER: qsample
MYSQL_PASSWORD: qsample2017
MYSQL_DATABASE: qsample
UID: 1000
GID: 1000
# More details in the documentation
# User to run database, act UID and GID accordingly thanks to 'uid -u' and 'uid -g'
# user: "${UID}:${GID}"
networks:
qsample:
aliases:
- database
# Below, compatible with depends in new docker compose versions (starting from 3.9)
# Situation: https://stackoverflow.com/questions/71060072/docker-compose-depends-on-with-condition-invalid-type-should-be-an-array
healthcheck:
test: ["CMD-SHELL", "mysql -h localhost -u root -p$${MYSQL_ROOT_PASSWORD} $${MYSQL_DATABASE} -e 'SELECT COUNT(*) FROM user limit 1;' || exit 1" ]
interval: 30s
timeout: 40s
start_period: 60s
retries: 15
app:
# image: ghcr.io/proteomicsunitcrg/qsample-server:latest # Pre-built version
build:
context: .
restart: always
volumes:
- type: bind
source: ./src/main/resources/application.yml
target: /config/application.yml
read_only: true
- ./tmp:/tmp
environment:
QSAMPLE_API_PREFIX: http://localhost:8099/ #Adapt for the final URL to be used
UID: 1000
GID: 1000
# More details in the documentation
# user: "${UID}:${GID}"
depends_on:
# - db
db:
condition: service_healthy
ports:
# Ports exposed outside, they should match config
- 8099:8099
networks:
qsample:
aliases:
- qsample
healthcheck:
test: ["CMD-SHELL", "curl -f $${QSAMPLE_API_PREFIX}api/config"]
interval: 30s
timeout: 10s
start_period: 30s
retries: 3
networks:
qsample: