-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
43 lines (39 loc) · 1018 Bytes
/
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
version: "3.1"
networks:
default:
external: true
name: ouroboros
services:
db:
container_name: mysql-studentportal-db
image: mysql:8.3.0
ports:
- "3307:3306" # Changed host port to 3307 to avoid conflicts
environment:
MYSQL_ROOT_PASSWORD: qwerty@123
MYSQL_DATABASE: StudentPortal
volumes:
- mysql_studentportal_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}"]
api:
container_name: studentportal-api
build:
context: .
dockerfile: Dockerfile
ports:
- "8082:8082"
depends_on:
- db
environment:
SERVER_PORT: 8082
SPRING_DATASOURCE_URL: jdbc:mysql://mysql-studentportal-db:3306/StudentPortal
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: qwerty@123
volumes:
- studentportal_api:/app
volumes:
mysql_studentportal_data:
driver: local
studentportal_api:
driver: local