-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
98 lines (95 loc) · 2.39 KB
/
docker-compose.yml
File metadata and controls
98 lines (95 loc) · 2.39 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
services:
api:
build:
context: .
dockerfile: Dockerfile
target: runner
image: noderax-api:latest
restart: unless-stopped
init: true
env_file:
- .env
environment:
NODE_ENV: production
PORT: 3000
NODERAX_STATE_DIR: /data/noderax
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_SSL: ${DATABASE_SSL:-false}
DATABASE_SYNCHRONIZE: ${DATABASE_SYNCHRONIZE:-false}
DATABASE_LOGGING: ${DATABASE_LOGGING:-false}
REDIS_ENABLED: ${REDIS_ENABLED:-true}
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD:-change-this-redis-password}
REDIS_DB: ${REDIS_DB:-0}
REDIS_KEY_PREFIX: ${REDIS_KEY_PREFIX:-noderax:}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "3000:3000"
volumes:
- noderax_state:/data/noderax
security_opt:
- no-new-privileges:true
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://127.0.0.1:3000/health').then((response) => process.exit(response.ok ? 0 : 1)).catch(() => process.exit(1))",
]
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_USERNAME:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
POSTGRES_DB: ${DB_NAME:-noderax}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U \"$${POSTGRES_USER}\" -d \"$${POSTGRES_DB}\"",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
redis:
image: redis:7-alpine
restart: unless-stopped
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:-change-this-redis-password}
command:
[
"sh",
"-c",
"exec redis-server --appendonly yes --save 60 1 --requirepass \"$${REDIS_PASSWORD}\"",
]
volumes:
- redis_data:/data
healthcheck:
test:
[
"CMD-SHELL",
"redis-cli --no-auth-warning -a \"$${REDIS_PASSWORD}\" ping | grep PONG",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
volumes:
postgres_data:
redis_data:
noderax_state: