-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
137 lines (130 loc) · 3.72 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
version: "3.7"
services:
app:
build:
context: .
target: dev-app
volumes:
- .:/app
- /app/node_modules
container_name: crawler-app
ports:
- "3000:3000"
environment:
APP_URL: http://localhost:3000
DB_URL: postgres://root:root@db:5432/crawler
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_AUTH: redis_pass
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
migrations:
condition: service_completed_successfully
networks:
- backend
worker:
build:
context: .
target: dev-worker
volumes:
- .:/app
- /app/node_modules
container_name: crawler-worker
init: true
ports:
- "3001:3000"
environment:
APP_URL: http://localhost:3000
DB_URL: postgres://root:root@db:5432/crawler
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_AUTH: redis_pass
security_opt:
- seccomp=./.docker/chrome/chrome.json
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
migrations:
condition: service_completed_successfully
networks:
- backend
scheduler:
build:
context: .
target: dev-scheduler
volumes:
- .:/app
- /app/node_modules
container_name: crawler-scheduler
ports:
- "3002:3000"
environment:
APP_URL: http://localhost:3000
DB_URL: postgres://root:root@db:5432/crawler
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_AUTH: redis_pass
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
migrations:
condition: service_completed_successfully
networks:
- backend
migrations:
build:
context: .
target: dev-app
volumes:
- .:/app
- /app/node_modules
container_name: crawler-migrations
entrypoint: ["npm", "run", "migrations:up"]
environment:
DB_URL: postgres://root:root@db:5432/crawler
depends_on:
db:
condition: service_healthy
networks:
- backend
db:
image: postgres:14.6
container_name: crawler-db
ports:
- "5432:5432"
volumes:
- ./.docker/postgres/postgres.conf:/etc/postgresql/postgresql.conf:delegated
- ./var/postgres-data:/var/lib/postgresql/data:cached
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
- POSTGRES_DB=crawler
command:
- postgres
- -c
- "config_file=/etc/postgresql/postgresql.conf"
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB'"]
interval: 10s
timeout: 5s
retries: 5
networks:
- backend
redis:
image: redis:7.0.10-alpine
container_name: crawler-redis
command: redis-server --loglevel warning --requirepass redis_pass --maxmemory-policy noeviction --appendonly yes
ports:
- "6379:6379"
networks:
- backend
networks:
backend: