-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdocker-compose.yml
111 lines (103 loc) · 2.41 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
version: '3'
networks:
web:
backend:
services:
# Front-end
web:
build:
context: ./web/
dockerfile: Dockerfile
networks:
- web
- backend
hostname: web
depends_on:
- api
# deploy:
# restart_policy:
# condition: on-failure
# delay: 5s
# max_attempts: 3
# window: 120s
environment:
- DATABASE_URL=postgres://postgres@db:5432/dev
ports:
- "3000:3000"
# Data API and authentication/authorization
api:
build:
context: ./api/
dockerfile: Dockerfile
networks:
- backend
hostname: api
depends_on:
- db
- redis
# deploy:
# restart_policy:
# condition: on-failure
# delay: 5s
# max_attempts: 3
# window: 120s
environment:
- CORS_ORIGIN=http://localhost:3000,http://localhost:3001
- DATABASE_URL=postgres://postgres@db:5432/dev
- DATABASE_DEBUG=false
- REDIS_URL=redis://redis:6379/0
- SESSION_SECRET=wZjwhFtzQsd7r87W6AZw45Sm
- FACEBOOK_ID=1821424564802638
- FACEBOOK_SECRET=2339bdf25f236a42fc3a18280bf455e8
- GOOGLE_ID=xxxxx.apps.googleusercontent.com
- GOOGLE_SECRET=xxxxx
- TWITTER_KEY=xxxxx
- TWITTER_SECRET=xxxxx
ports:
- "8080:8080"
- "127.0.0.1:9229:9229" # V8 inspector for tools/run.js
- "127.0.0.1:9230:9230" # V8 inspector for src/server.js
volumes:
- yarn:/home/node/.cache/yarn
- ./api:/usr/src/app/
command: node tools/run.js # or, `node --inspect=0.0.0.0:9229 tools/run.js`
# SQL and document data store
db:
image: postgres:9.6.5-alpine
networks:
- backend
# deploy:
# restart_policy:
# condition: on-failure
# delay: 5s
# max_attempts: 3
# window: 120s
read_only: true
tmpfs:
- /tmp
- /var/run/postgresql
volumes:
- db:/var/lib/postgresql/data
- ./api/postgres-initdb.sh:/docker-entrypoint-initdb.d/initdb.sh
# ports:
# - "127.0.0.1:5432:5432" # you can override it via docker-compose.override.yml
# Distributed in-memory cache
redis:
image: redis:4.0.2-alpine
networks:
- backend
# deploy:
# restart_policy:
# condition: on-failure
# delay: 5s
# max_attempts: 3
# window: 120s
read_only: true
volumes:
- redis:/data
user: redis
volumes:
api:
db:
redis:
yarn: