-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
38 lines (36 loc) · 1.35 KB
/
compose.yaml
File metadata and controls
38 lines (36 loc) · 1.35 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
services:
mariadb:
# Pin version for image 'mariadb:11.4.7' with specific digest hash
image: mariadb@sha256:1d18f91deb21136d1881705720071d1b474a9904ecca827058bf1c0fc64d3118
command: mariadbd --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
- MARIADB_DATABASE=${ENV_MARIADB_DATABASE}
- MARIADB_ROOT_PASSWORD=${ENV_MARIADB_PASSWORD}
healthcheck:
test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
start_period: 8s # Gives MariaDB a grace period before checks begin
interval: 5s # Checks every 5 seconds
timeout: 5s # Maximum amount of time Docker will wait for the healthcheck command
retries: 10 # Allows up to (interval * retries) seconds for MariaDB to become ready
networks:
- backend
volumes:
# Mount host dir to persist MariaDB data outside the container
- /mariadb-data:/var/lib/mysql
# Mount initialization scripts (like create-databases)
- ./scripts/initdb:/docker-entrypoint-initdb.d
backend-dev:
build:
context: .
image: showcase-app-backend-dev:0.0.1
depends_on:
mariadb:
condition: service_healthy
environment:
SPRING_DATASOURCE_URL: jdbc:mariadb://showcase-app-mariadb-1:3306/showcase_dev
networks:
- backend
ports:
- "9007:8080"
networks:
backend: