-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
27 lines (24 loc) · 1.22 KB
/
docker-compose.yml
File metadata and controls
27 lines (24 loc) · 1.22 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
version: '3.8' # Docker Compose file version
services:
dbservice:
image: mysql # Use the official MySQL Docker image
environment:
- MYSQL_ROOT_PASSWORD=Mume@143 # Set the root password for MySQL
ports:
- 3308:3306 # Map host port 3308 to container port 3306 for MySQL
networks:
- reviewapp # Attach the service to the 'reviewapp' network
appservice:
build: . # Build the Docker image for the app service using the current directory (where Dockerfile is)
depends_on:
- dbservice # Specify that the 'appservice' depends on the 'dbservice' (waits for it to start)
environment:
- spring.datasource.url=jdbc:mysql://dbservice:3306/websitereview?createDatabaseIfNotExist=true # Configure the Spring Boot app to use MySQL database at 'dbservice'
- spring.datasource.username=root # MySQL username
- spring.datasource.password=Mume@143 # MySQL password
ports:
- 8080:8080 # Map host port 8080 to container port 8080 for the Spring Boot app
networks:
- reviewapp # Attach the service to the 'reviewapp' network
networks:
reviewapp: # Define a custom Docker network named 'reviewapp' for services to communicate