-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
45 lines (41 loc) · 991 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
40
41
42
43
44
45
version: "3.9"
services:
spring-api-image:
# image: nk-recipes-api:latest
image: yan640/nk-recipes-api:lastest
# build:
# context: .
# dockerfile: Dockerfile
container_name: nk-spring-api
ports:
- "8080:8080"
volumes:
- .:/app
networks:
- spring-network
depends_on:
- mysql
# environment:
# - SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/db_recipes_api
# - SPRING_DATASOURCE_USERNAME=nk-yannick
# - SPRING_DATASOURCE_PASSWORD=101010
mysql:
image: mysql
container_name: nk-mysql
environment:
MYSQL_ROOT_PASSWORD: 1234
MYSQL_DATABASE: db_recipes_api
MYSQL_USER: nk-yannick
MYSQL_PASSWORD: 101010
ports:
- "3307:3306"
networks:
- spring-network
volumes:
- mysql-volume:/var/lib/mysql
- ./init-db-scripts:/docker-entrypoint-initdb.d # fix exec init.sql
networks:
spring-network:
driver: bridge
volumes:
mysql-volume: