This repository was archived by the owner on Dec 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (47 loc) · 1.33 KB
/
docker-compose.yml
File metadata and controls
51 lines (47 loc) · 1.33 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
version: "3.8"
services:
db:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: mypassword
MYSQL_DATABASE: mydatabase
MYSQL_USER: myusername
MYSQL_PASSWORD: mypassword
ports:
- "3306:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "myusername", "--password=mypassword"]
interval: 10s
timeout: 5s
retries: 5
db-loader:
image: python:3.8
depends_on:
- db
volumes:
- "./mysql-init:/docker-entrypoint-initdb.d"
environment:
MYSQL_USER: myusername
MYSQL_PASSWORD: mypassword
MYSQL_DATABASE: mydatabase
command: [ "/bin/bash", "-c", "pip install -r /docker-entrypoint-initdb.d/requirements.txt && python /docker-entrypoint-initdb.d/load_data.py" ]
test-db:
image: mysql:latest
environment:
MYSQL_DATABASE: test_db
MYSQL_USER: testuser
MYSQL_PASSWORD: testpassword
MYSQL_ROOT_PASSWORD: rootpassword
ports:
- "3308:3306"
app:
build: .
depends_on:
db:
condition: service_healthy
ports:
- "8080:8080"
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://db:3306/mydatabase?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
SPRING_DATASOURCE_USERNAME: myusername
SPRING_DATASOURCE_PASSWORD: mypassword