forked from DanKottke/midas
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
113 lines (113 loc) · 2.45 KB
/
docker-compose.yml
File metadata and controls
113 lines (113 loc) · 2.45 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
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
112
113
version: '3'
services:
app:
# Uncomment the entrypoint to peek inside failing container builds.
# ex: docker-compose exec app bash
# entrypoint: ["sh", "-c", "sleep infinity"]
build:
dockerfile: Dockerfile
context: .
volumes:
- .:/app/
- node-modules:/app/node_modules/
working_dir: /app
command:
- /wait-for-migrate-db-container.sh
- db
- npm run watch
ports:
- 3000:3000
links:
- db
networks:
- backend
environment:
- HOST=localhost
- DB_HOST=db
- DB_USER=midas
- DB_NAME=midas
- DATABASE_URL=postgres://midas@db/midas
- DATASTORE=postgresql
- REDIS_HOST=redis_db
- REDIS_URL=redis://redis_db:6379
- LOG_LEVEL=silly
- PORT=3000
- EMAIL_SYSTEM_ADDRESS=docker@openopps.local
- EMAIL_HOST=mail
- EMAIL_SSL=false
- EMAIL_IGNORE_TLS=true
- EMAIL_PORT=25
- SAILS_SECRET=just_for_testing_yo
depends_on:
- db
- redis_db
- migrate_db
- init_db
# README: Migrate the database so that npm run init can write to it.
migrate_db:
networks:
- backend
build:
dockerfile: Dockerfile
context: .
working_dir: /app
command: npm run migrate:up
volumes:
- .:/app
- node-modules:/app/node_modules/
environment:
- DATABASE_URL=postgres://midas@db/midas
- DATASTORE=postgresql
- LOG_LEVEL=silly
- PORT=3002
links:
- db
depends_on:
- db
# README: Initialize the database so that Sails can connect to it.
init_db:
networks:
- backend
build:
dockerfile: Dockerfile
context: .
command:
- /wait-for-migrate-db-container.sh
- db
- npm run init
volumes:
- node-modules:/app/node_modules/
environment:
- DATABASE_URL=postgres://midas@db/midas
- DATASTORE=postgresql
- LOG_LEVEL=silly
- PORT=3001
links:
- db
depends_on:
- db
- migrate_db
db:
networks:
- backend
image: postgres:9.6
volumes:
- pgdata:/var/lib/postgresql/data/
environment:
- POSTGRES_DB=midas
- POSTGRES_USER=midas
redis_db:
image: redis:4.0.10
command: ["redis-server", "--appendonly", "yes"]
hostname: redis
networks:
- backend
volumes:
- redis-data:/data
volumes:
node-modules:
pgdata:
redis-data:
networks:
backend:
driver: bridge