-
Notifications
You must be signed in to change notification settings - Fork 68
/
docker-compose.yml
69 lines (66 loc) · 2.23 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
version: '3'
services:
database:
build:
context: ./deps/openhospital-core
dockerfile: Dockerfile-ohdb
args:
OH_DB_LANG: ${OH_DB_LANG}
image: oh-core_database:latest
ports:
- "${OH_MARIADB_PORT}:3306"
command: mysqld --sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" --lower_case_table_names=1 --explicit_defaults_for_timestamp=OFF
environment:
MARIADB_DATABASE: ${OH_MARIADB_DATABASE}
MARIADB_ROOT_PASSWORD: ${OH_MARIADB_ROOT_PASSWORD}
MARIADB_USER: ${OH_MARIADB_USER}
MARIADB_PASSWORD: ${OH_MARIADB_PASSWORD}
networks:
- hospital-net
restart: unless-stopped
oh-database-init:
image: oh-core_database:latest
command: >
sh -c "mysql -v --host database -u ${OH_MARIADB_USER} -p${OH_MARIADB_PASSWORD} ${OH_MARIADB_DATABASE} < /database-sources/delete_all_data.sql &&
mysql -v --host database -u ${OH_MARIADB_USER} -p${OH_MARIADB_PASSWORD} ${OH_MARIADB_DATABASE} < /database-sources/load_demo_data.sql"
depends_on:
- database
working_dir: /database-sources
environment:
MARIADB_MYSQL_LOCALHOST_USER: "true"
MARIADB_DATABASE: ${OH_MARIADB_DATABASE}
MARIADB_ROOT_PASSWORD: ${OH_MARIADB_ROOT_PASSWORD}
MARIADB_USER: ${OH_MARIADB_USER}
MARIADB_PASSWORD: ${OH_MARIADB_PASSWORD}
volumes:
- ./deps/openhospital-core/sql:/database-sources # /docker-entrypoint-initdb.d
networks:
- hospital-net
backend:
container_name: backend
build:
context: .
dockerfile: Dockerfile.backend
args:
OH_CORE_BRANCH: ${OH_CORE_BRANCH}
OH_API_BRANCH: ${OH_API_BRANCH}
GITHUB_ORG: ${GITHUB_ORG}
restart: always
ports:
- "${API_PORT}:8080"
depends_on:
- database
environment:
SPRING_DATASOURCE_URL: jdbc:mariadb://database:3306/${OH_MARIADB_DATABASE}
SPRING_DATASOURCE_USERNAME: ${OH_MARIADB_USER}
SPRING_DATASOURCE_PASSWORD: ${OH_MARIADB_PASSWORD}
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "10"
networks:
- hospital-net
networks:
hospital-net:
driver: bridge