-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdocker-compose.yml
48 lines (45 loc) · 1023 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
46
47
48
version: "3.5"
services:
app:
container_name: golang-book-api
build:
context: .
dockerfile: Dockerfile
ports:
- 9002:9002
restart: on-failure
environment:
APP_ENV: local
volumes:
- type: volume
source: api
target: /usr/src/app
depends_on:
- book-store-mysql
command: ["./wait-for", "book-store-mysql:3306", "--", "--", "./main"]
networks:
- book-store
book-store-mysql:
image: mysql:8.0.19
container_name: full_db_mysql
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: 'root'
MYSQL_DATABASE: 'book_store'
MYSQL_USER: 'root'
MYSQL_PASSWORD: 'root'
MYSQL_ROOT_HOST: 'book-store-mysql'
volumes:
- type: volume
source: database_mysql
target: /var/lib/mysql
networks:
- book-store
volumes:
api:
database_mysql:
# Networks to be created to facilitate communication between containers
networks:
book-store:
driver: bridge