-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose.yml
27 lines (24 loc) · 1.05 KB
/
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
version: '3.8'
services:
db:
container_name: db
image: mysql:latest
restart: always
ports:
- "3306:3306" # MySQL uses port 3306
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: your_database_name # Replace with your desired database name
MYSQL_USER: your_mysql_user # Replace with your desired MySQL username
MYSQL_PASSWORD: your_mysql_password # Replace with your desired MySQL password
app:
container_name: app
image: rimmelasghar/spring-boot-boilerplate:2.2.0
ports:
- "8080:8080"
environment:
- "SPRING_DATASOURCE_URL=jdbc:mysql://db:3306/your_database_name" # Replace 'your_database_name' with the same name you used for MYSQL_DATABASE in the db service.
- "SPRING_DATASOURCE_USERNAME=your_mysql_user" # Replace 'your_mysql_user' with the same name you used for MYSQL_USER in the db service.
- "SPRING_DATASOURCE_PASSWORD=your_mysql_password" # Replace 'your_mysql_password' with the same name you used for MYSQL_PASSWORD in the db service.
depends_on:
- db