-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (52 loc) · 1.38 KB
/
docker-compose.yml
File metadata and controls
57 lines (52 loc) · 1.38 KB
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
49
50
51
52
53
54
55
56
# version: '3.8' ←今はやらなくて良いらしい
# 正直、dbだけdocker-composeで他はTerminalやコマンドプロンプトで起動する
# (以下のapi, appをコメントアウトしてdocker-compose up)
# が一番開発しやすいです
services:
db:
image: mysql:8.0.32
platform: linux/amd64 #mac環境で必須なことがあるらしい
env_file: ./db/.env
container_name: v_kara_db
build:
context: ./db
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 5s
retries: 10
ports:
- "3306:3306"
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
api:
build:
context: ./t0016Go
container_name: v_kara_api
env_file: ./t0016Go/.env
environment:
- IS_DOCKER_COMPOSE=true
stdin_open: true
tty: true
volumes:
- ./t0016Go:/api/src
depends_on:
db:
condition: service_healthy
ports:
- "8080:8080"
# `make db-be` でdb, apiのみをdocker composeで起動できます
app:
build:
context: ./t0016Next
container_name: v_kara_app
env_file: ./t0016Next/.env
environment:
- IS_DOCKER_COMPOSE=true
stdin_open: true
tty: true
volumes:
- ./t0016Next/myapp:/app/src
ports:
- "80:80"
############
# docker compose up db
# cd /t0016Go/cmd && go run .