-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
28 lines (25 loc) · 853 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
28 lines (25 loc) · 853 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
version: '3.8'
services:
mysql:
image: mysql:8.0
container_name: mysqlcontainer
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${MYSQLDB_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQLDB_DATABASE}
ports:
- "${MYSQLDB_DOCKER_PORT}:${MYSQLDB_LOCAL_PORT}"
springboot-app:
build: .
container_name: springboot-app
depends_on:
- mysql
restart: on-failure
ports:
- "${SPRING_DOCKER_PORT}:${SPRING_LOCAL_PORT}"
- "${DEBUG_PORT}:${DEBUG_PORT}"
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://mysqlcontainer:3306/${MYSQLDB_DATABASE}
SPRING_DATASOURCE_USERNAME: ${MYSQLDB_USER}
SPRING_DATASOURCE_PASSWORD: ${MYSQLDB_ROOT_PASSWORD}
JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:${DEBUG_PORT}"