-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
40 lines (37 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
37
38
39
40
version: '3.8'
networks:
default:
services:
mysqldb:
image: mysql:5.7
restart: unless-stopped
env_file: ./.env
environment:
- MYSQL_DATABASE=$MYSQL_DATABASE
- MYSQL_USER=$MYSQL_USER
- MYSQL_PASSWORD=$MYSQL_PASSWORD
- MYSQL_ALLOW_EMPTY_PASSWORD=no
ports:
- ${MYSQL_PORT}:$MYSQL_PORT
volumes:
- "mysql_data:/var/lib/mysql"
app:
depends_on:
- mysqldb
build: .
restart: on-failure
ports:
- ${APP_PORT}:$APP_PORT
environment:
SPRING_APPLICATION_JSON: '{
"spring.datasource.url" : "jdbc:mysql://mysqldb:${MYSQL_PORT}/${MYSQL_DATABASE}?useSSL=false",
"spring.datasource.username" : "${MYSQL_USER}",
"spring.datasource.password" : "${MYSQL_PASSWORD}",
"spring.jpa.properties.hibernate.dialect" : "org.hibernate.dialect.MySQLDialect",
"spring.jpa.hibernate.ddl-auto" : "update",
"api.auth.token" : "${URLSHORTENER_API_TOKEN}"
}'
stdin_open: true
tty: true
volumes:
mysql_data: