-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
43 lines (41 loc) · 1.38 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
version: "3.6"
services:
project:
image: spring-boot-app:latest
# restart: on-failure
build:
context: ./
dockerfile: Dockerfile
ports:
- "8080:8080"
# volumes:
# - ./:/app
# working_dir: /app
# command: sh -c "pwd &&
# ./wait-for.sh db:3306 -- java -jar /target/app.jar"
depends_on:
- db
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://db:3306/library
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: root
db:
image: mysql:latest
# restart: on-failure
# command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --default-authentication-plugin=mysql_native_password
# command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_DATABASE: library
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: test
MYSQL_PASSWORD: test
## Stops showing mbind: Operation not permitted?
cap_add:
- SYS_NICE # CAP_SYS_NICE
# volumes:
# - ./dump/data.sql:/docker-entrypoint-initdb.d/init.sql:ro
# - ./db_data:/var/lib/mysql:rw
## To configure docker-compose with springboot, mysql, and docker-compose.
# https://www.callicoder.com/spring-boot-mysql-react-docker-compose-example/
## Add schema.sql to mysql.
# https://stackoverflow.com/questions/29145370/how-can-i-initialize-a-mysql-database-with-schema-in-a-docker-container