-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
37 lines (35 loc) · 950 Bytes
/
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
version: "3.8"
services:
mysqldb:
image: mysql:5.7
restart: unless-stopped
env_file: ./.env
environment:
- MYSQL_ROOT_PASSWORD=$MYSQLDB_ROOT_PASSWORD
- MYSQL_DATABASE=$MYSQLDB_DATABASE
ports:
- $MYSQLDB_LOCAL_PORT:$MYSQLDB_DOCKER_PORT
volumes:
- mysqlvolume:/var/lib/mysql
app:
depends_on:
- mysqldb
build:
context: ./
dockerfile: Dockerfile
working_dir: /usr/src/todosimpleapp
container_name: todosimpleapp
restart: on-failure
env_file: ./.env
ports:
- $SPRING_LOCAL_PORT:$SPRING_DOCKER_PORT
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://mysqldb:$MYSQLDB_DOCKER_PORT/$MYSQLDB_DATABASE?useSSL=false&createDatabaseIfNotExist=true
- SPRING_DATASOURCE_USERNAME=$MYSQLDB_USER
- SPRING_DATASOURCE_PASSWORD=$MYSQLDB_ROOT_PASSWORD
volumes:
- .m2:/root/.m2
stdin_open: true
tty: true
volumes:
mysqlvolume: