-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
56 lines (56 loc) · 1.24 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
version: "3"
services:
db:
image: postgres
ports:
- 5433:5433
volumes:
- pgdata:/var/lib/postgresql/data
environment:
POSTGRES_HOST_AUTH_METHOD: trust
web:
build:
context: .
args:
WORKDIR: $WORKDIR
command: /bin/sh -c "rm -f tmp/pids/server.pid && bundle exec rails s -b '0.0.0.0'"
depends_on:
- db
ports:
- "$API_PORT:$CONTAINER_PORT"
environment:
DATABASE_HOST: db
BUNDLE_PATH: "/bundle"
FRONT_DOMAIN: "localhost:$FRONT_PORT"
API_URL: "http://localhost:$API_PORT"
tty: true
stdin_open: true
volumes:
- .:/$WORKDIR:delegated
- bundle:/bundle:delegated
swagger:
image: swaggerapi/swagger-ui
volumes:
- ./openapi:/usr/share/nginx/html/openapi
environment:
API_URL: ./openapi/openapi.yaml
ports:
# NOTE: ホストからは8081で接続する
- 8081:8080
front:
build:
context: ./front
args:
WORKDIR: $WORKDIR
CONTAINER_PORT: $CONTAINER_PORT
API_URL: "http://localhost:$API_PORT"
command: yarn run dev
volumes:
- ./front:/$WORKDIR
ports:
- "$FRONT_PORT:$CONTAINER_PORT"
depends_on:
- web
volumes:
pgdata:
bundle: