-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
39 lines (36 loc) · 960 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
38
39
version: "3.8"
services:
mysqldb:
container_name: mysqldb
image: mysql
environment:
MYSQL_USER: springuser
MYSQL_PASSWORD: ThePassword
MYSQL_DATABASE: db_example
MYSQL_ROOT_PASSWORD: root
ports:
- 3303:3306
volumes:
- ./mysql-data:/var/lib/mysql
networks:
springboot-mysql-net:
springboot-restful-webservices:
container_name: springboot-restful-webservices
build:
context: ./java-mysql
dockerfile: Dockerfile
ports:
- 8080:8080
depends_on:
- mysqldb
environment:
- spring.jpa.hibernate.ddl-auto=update
- spring.datasource.url=jdbc:mysql://mysqldb:3306/db_example
- spring.datasource.username=springuser
- spring.datasource.password=ThePassword
- spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
networks:
springboot-mysql-net:
restart: on-failure
networks:
springboot-mysql-net: