-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
46 lines (42 loc) · 1.59 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
37
38
39
40
41
42
43
44
45
46
# Docker Compose file Reference (https://docs.docker.com/compose/compose-file/)
# Define services
services:
# Database Service (MySQL)
pharmacies-on-duty-attica-db:
image: mysql:8.0.36
ports:
- "3308:3306"
restart: always
environment:
MYSQL_DATABASE: pharmacies
MYSQL_USER: developer
MYSQL_PASSWORD: developer
MYSQL_ROOT_PASSWORD: root
volumes:
- db-data:/var/lib/mysql
networks:
- backend
# 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 root 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:
- pharmacies-on-duty-attica-db # This service depends on MySQL. Start that first.
environment: # Pass environment variables to the service.
TZ: "Europe/Athens"
SPRING_DATASOURCE_URL: jdbc:mysql://pharmacies-on-duty-attica-db:3306/pharmacies?createDatabaseIfNotExist=true&useSSL=false&serverTimezone=UTC&useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&allowPublicKeyRetrieval=true
SPRING_DATASOURCE_USERNAME: developer
SPRING_DATASOURCE_PASSWORD: developer
networks: # Networks to join (Services on the same network can communicate with each other using their name)
- backend
# Volumes
volumes:
db-data:
# Networks to be created to facilitate communication between containers
networks:
backend: