-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
60 lines (57 loc) · 1.69 KB
/
Copy pathdocker-compose.yml
File metadata and controls
60 lines (57 loc) · 1.69 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
services:
api:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
environment:
DATABASE_URL: mysql://${MYSQL_USER:-parsehub}:${MYSQL_PASSWORD:-parsepwd}@mysql:3306/${MYSQL_DATABASE:-parsehub}
REDIS_URL: redis://redis:6379
ports:
- "${API_BIND_IP:-127.0.0.1}:${API_PORT:-3000}:3000"
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/healthz').then((response) => process.exit(response.ok ? 0 : 1)).catch(() => process.exit(1))"]
interval: 15s
timeout: 5s
retries: 10
start_period: 40s
mysql:
image: mysql:8.4
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE:-parsehub}
MYSQL_USER: ${MYSQL_USER:-parsehub}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-parsepwd}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-replace-with-strong-mysql-root-password}
ports:
- "127.0.0.1:${MYSQL_PORT:-3306}:3306"
volumes:
- parsehub_mysql:/var/lib/mysql
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -u$${MYSQL_USER:-parsehub} -p$${MYSQL_PASSWORD:-parsepwd} --silent"]
interval: 5s
timeout: 3s
retries: 20
redis:
image: redis:7-alpine
command: ["redis-server", "--appendonly", "yes"]
ports:
- "127.0.0.1:${REDIS_PORT:-6379}:6379"
volumes:
- parsehub_redis:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 20
volumes:
parsehub_mysql:
parsehub_redis: