Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (88 loc) · 2.22 KB
/
Copy pathdocker-compose.yml
File metadata and controls
97 lines (88 loc) · 2.22 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
x-byline-env: &byline-env
TZ: ${TZ:-UTC}
NODE_ENV: production
PORT: '2333'
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-}
PG_HOST: postgres
PG_PORT: '5432'
PG_USER: ${PG_USER:-byline}
PG_PASSWORD: ${PG_PASSWORD:-byline}
PG_DATABASE: ${PG_DATABASE:-byline}
REDIS_HOST: redis
REDIS_PORT: '6379'
SNOWFLAKE_WORKER_ID: ${SNOWFLAKE_WORKER_ID:-1}
JWT_SECRET: ${JWT_SECRET:?Set JWT_SECRET to 32+ random characters}
ENCRYPT_ENABLE: ${ENCRYPT_ENABLE:-false}
ENCRYPT_KEY: ${ENCRYPT_KEY:-}
TRUST_PROXY: ${TRUST_PROXY:-}
x-runtime-safety: &runtime-safety
ulimits:
core:
soft: 0
hard: 0
logging:
driver: json-file
options:
max-size: '10m'
max-file: '3'
services:
byline:
<<: *runtime-safety
image: ${BYLINE_IMAGE:-innei/byline:latest}
restart: unless-stopped
ports:
- '${BYLINE_PORT:-2333}:2333'
environment:
<<: *byline-env
BYLINE_AUTO_MIGRATE: 'false'
volumes:
- byline-data:/root/.byline
depends_on:
migrate:
condition: service_completed_successfully
redis:
condition: service_healthy
migrate:
<<: *runtime-safety
image: ${BYLINE_IMAGE:-innei/byline:latest}
command: ['node', 'migrate.mjs']
restart: 'no'
environment: *byline-env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
postgres:
<<: *runtime-safety
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${PG_USER:-byline}
POSTGRES_PASSWORD: ${PG_PASSWORD:-byline}
POSTGRES_DB: ${PG_DATABASE:-byline}
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U "$${POSTGRES_USER}" -d "$${POSTGRES_DB}"']
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
redis:
<<: *runtime-safety
image: redis:8-alpine
restart: unless-stopped
command: ['redis-server', '--appendonly', 'yes']
volumes:
- redis-data:/data
healthcheck:
test: ['CMD-SHELL', 'redis-cli ping | grep PONG']
interval: 10s
timeout: 3s
retries: 10
start_period: 5s
volumes:
byline-data:
postgres-data:
redis-data: