-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
48 lines (44 loc) · 1.39 KB
/
docker-compose.yml
File metadata and controls
48 lines (44 loc) · 1.39 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Docker Compose file Reference (https://docs.docker.com/compose/compose-file/)
version: '3.7'
# Define services
services:
# Spring boot service
app-server:
# Configuration for building the docker image for the backend service
build:
context: .
dockerfile: Dockerfile
ports:
- "9091:9091" # Forward the exposed port 9091 on the container to port 9091 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/customdiff?useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false
SPRING_DATASOURCE_USERNAME: customdiff
SPRING_DATASOURCE_PASSWORD: customdiff
networks:
- backend
# Database Service (Mysql)
db:
image: mysql:5.7.28
ports:
- "33307:3306"
restart: always
environment:
MYSQL_DATABASE: customdiff
MYSQL_USER: customdiff
MYSQL_PASSWORD: customdiff
MYSQL_ROOT_PASSWORD: root
command: mysqld --sql_mode="" --lower_case_table_names=1
volumes:
- db-data:/var/lib/mysql
- ./src/main/resources/META-INF/SQL-statements/dump.sql:/docker-entrypoint-initdb.d/dump.sql
networks:
- backend
# Volumes
volumes:
db-data:
# Networks to be created to facilitate communication between containers
networks:
backend: