-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
73 lines (73 loc) · 2.03 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
61
62
63
64
65
66
67
68
69
70
71
72
73
version: '3'
services:
# connect from host using: "mysql -hlocalhost -Dalgorea_db -ualgorea -pa_db_password --protocol=TCP"
db:
image: mysql:8.0.28
command: --default-authentication-plugin=mysql_native_password --max-allowed-packet=10485760 --innodb_lock_wait_timeout=1 --skip-log-bin
restart: always
ports:
- "3306:3306"
- "33060:33060"
volumes:
- mysql-volume:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: a_root_db_password
MYSQL_USER: algorea
MYSQL_PASSWORD: a_db_password
MYSQL_DATABASE: algorea_db
MYSQL_ROOT_HOST: "%"
security_opt:
- seccomp:unconfined
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
db_test:
image: mysql:8.0.28
command: --default-authentication-plugin=mysql_native_password --innodb_lock_wait_timeout=1 --skip-log-bin
restart: always
ports:
- "3307:3306"
- "33070:33060"
volumes:
- type: tmpfs
target: /var/lib/mysql
tmpfs:
size: 314572800 # Size in bytes, 300MB
environment:
MYSQL_ROOT_PASSWORD: a_root_db_password
MYSQL_USER: algorea
MYSQL_PASSWORD: a_db_password
MYSQL_DATABASE: algorea_db
MYSQL_ROOT_HOST: "%"
security_opt:
- seccomp:unconfined
backend:
build: .
ports:
- "8080:8080"
links:
- db
depends_on:
db:
condition: service_healthy
environment:
ALGOREA_ENV: dev
ALGOREA_DATABASE__ADDR: db
ALGOREA_DATABASE__USER: algorea
ALGOREA_DATABASE__PASSWD: a_db_password
ALGOREA_DATABASE__DBNAME: algorea_db
ALGOREA_LOGGING__FORMAT: text
ALGOREA_LOGGING__OUTPUT: stdout
ALGOREA_LOGGING__LOGSQLQUERIES: 0
ALGOREA_LOGGING__LEVEL: debug
volumes:
- ./db/migrations/:/go/src/AlgoreaBackend/db/migrations/:ro
command: >
/bin/sh -c "
echo \"Wait 1sec for MySQL to be ready...\";
sleep 2;
AlgoreaBackend serve;
"
volumes:
mysql-volume: