-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
36 lines (33 loc) · 1.04 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
28
29
30
31
32
33
34
35
36
version: "3.8"
# Define services
services:
# App backend service
app-server:
# Configuration for building the docker image for the backend service
build:
context: ./ # Use an image built from the specified dockerfile in the `polling-app-server` directory.
dockerfile: Dockerfile
ports:
- "8080:8080" # Forward the exposed port 8080 on the container to port 8080 on the host machine
restart: always
depends_on:
- db # This service depends on mysql. Start that first.
environment: # Pass environment variables to the service
SPRING_DATASOURCE_URL: jdbc:mysql://db:3306/domus?useSSL=false&allowPublicKeyRetrieval=true
SPRING_DATASOURCE_USERNAME: springboot
SPRING_DATASOURCE_PASSWORD: domus_20
# Database Service (Mysql)
db:
image: mysql:8
ports:
- "3307:3306"
environment:
MYSQL_DATABASE: domus
MYSQL_USER: springboot
MYSQL_PASSWORD: domus_20
MYSQL_ROOT_PASSWORD: root
volumes:
- db-data:/var/lib/mysql
# Volumes
volumes:
db-data: