-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
59 lines (58 loc) · 1.44 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
version: '3'
# 3にしないとcircleciに怒られる
services:
db:
image: mysql:8.0
environment:
MYSQL_ROOT_USER: root
MYSQL_ROOT_PASSWORD: password
ports:
- '3306:3306'
command: --default-authentication-plugin=mysql_native_password
#native_passwordはMySQL8.0だとold機能.後でmysqlのバージョンを変えた時に、変更
volumes:
- mysql-data:/var/lib/mysql
api:
build:
context: ./api
args:
# WORKDIR: $WORKDIR
WORKDIR: api
environment:
# API_DOMAIN: "http://localhost:$FRONT_PORT"
API_DOMAIN: "http://localhost:3001"
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
volumes:
- ./api:/cooklog
- gem_data:/usr/local/bundle
ports:
# - "$API_PORT:$CONTAINER_PORT"
- '3000:3000'
depends_on:
- db
stdin_open: true
tty: true
frontend:
build:
context: ./frontend
args:
# WORKDIR: $WORKDIR
# CONTAINER_PORT: $CONTAINER_PORT
# REACT_APP_API_URL: "http://localhost:$API_PORT"
WORKDIR: api
CONTAINER_PORT: 3000
REACT_APP_API_URL: "http://localhost:3000"
command: yarn start
ports:
# - "$FRONT_PORT:$CONTAINER_PORT"
- '3001:3000'
volumes:
- ./frontend:/cooklog
depends_on:
- api
stdin_open: true
tty: true
volumes:
mysql-data:
gem_data:
driver: local