-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
39 lines (36 loc) · 1.01 KB
/
docker-compose.yaml
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
version: '3'
networks:
mariadb-spring:
driver: bridge
services:
db:
image: mariadb:latest
restart: always
volumes:
- ./database:/var/lib/mysql
# - ./shoe_shopdb.sql:/docker-entrypoint-initdb.d/shoe_shopdb.sql
networks:
- mariadb-spring
environment:
# This is the need ENV for mariadb.
MYSQL_ROOT_PASSWORD: ${DATABASE_ROOT_PASSWORD}
MYSQL_DATABASE : ${DATABASE_NAME}
MYSQL_USER: ${DATABASE_USERNAME}
MYSQL_PASSWORD: ${DATABASE_PASSWORD}
DATABASE_PORT: ${DATABASE_PORT}
app:
build:
context: .
dockerfile: Dockerfile
depends_on:
- db
restart: always
networks:
- mariadb-spring
ports:
- "8081:8080"
environment:
# Connnection String for app. It gonna override the string in application.properties
SPRING_DATASOURCE_URL: jdbc:mysql://${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}
SPRING_DATASOURCE_USERNAME: ${DATABASE_USERNAME}
SPRING_DATASOURCE_PASSWORD: ${DATABASE_PASSWORD}