-
Notifications
You must be signed in to change notification settings - Fork 8
/
docker-compose.yml
70 lines (60 loc) · 1.5 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
version: '3.4'
# shared config for webserver, url-fetcher and stream-loader services
x-docnow: &docnow
environment:
- REDIS_HOST=redis
- DB_HOSTNAME=db
- DB_USERNAME
- DB_PASSWORD
- DB_DATABASE
- NODE_ENV
- CONSUMER_KEY
- CONSUMER_SECRET
- ACCESS_TOKEN
- ACCESS_TOKEN_SECRET
build:
context: .
volumes:
- ./src:/code/src
- ./test:/code/test
depends_on:
- db
- redis
links:
- db
- redis
services:
redis:
image: redis
db:
image: postgres
restart: always
environment:
POSTGRES_USER: "${DB_USERNAME}"
POSTGRES_PASSWORD: "${DB_PASSWORD}"
POSTGRES_DB: "${DB_DATABASE}"
volumes:
- ./config/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
command: postgres -c logging_collector=on -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all
webapp:
<<: *docnow
entrypoint: src/commands/wait-for-it.sh -t 120 db:5432 -- ./entrypoint.sh
ports:
- 3000:3000
tweet-loader:
<<: *docnow
entrypoint: src/commands/wait-for-it.sh -t 120 db:5432 -- npm run tweet-loader
url-fetcher:
<<: *docnow
entrypoint: src/commands/wait-for-it.sh -t 120 db:5432 -- npm run url-fetcher
pghero:
image: ankane/pghero
container_name: pghero
ports:
- 3001:8080
environment:
DATABASE_URL: "postgres://${DB_USERNAME}:${DB_PASSWORD}@db:5432/${DB_DATABASE}"
volumes:
- ./config/pghero.yml:/app/config/pghero.yml
links:
- db