-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
47 lines (44 loc) · 922 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
47 lines (44 loc) · 922 Bytes
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
services:
mysql:
container_name: mysql
image: mysql:8.4.0
ports:
- "3307:3306"
environment:
- MYSQL_DATABASE=libraryApi
- MYSQL_ROOT_PASSWORD=root
volumes:
- mysql-data:/var/lib/mysql
networks:
- stack
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p", "root"]
interval: 30s
timeout: 10s
retries: 3
application:
container_name: app
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
environment:
- SPRING_PROFILES_ACTIVE=prod
- DB_HOST=mysql
- DB_PORT=3306
- DB_DATABASE=libraryApi
- DB_USERNAME=root
- DB_PASSWORD=root
networks:
- stack
depends_on:
mysql:
condition: service_healthy
networks:
stack:
name: stack
driver: bridge
volumes:
mysql-data:
name: mysql-data