-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
147 lines (138 loc) · 4.16 KB
/
docker-compose.yml
File metadata and controls
147 lines (138 loc) · 4.16 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
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
138
139
140
141
142
143
144
145
146
147
name: article30
# Production base - pulls release images from GHCR. Plain
# docker compose --env-file .env.prod up -d
# pulls ghcr.io/ipsec-dev/article30/{backend,frontend} at ARTICLE30_VERSION
# (default: latest) and starts the stack.
#
# Overlays in build/:
# - build/dev.compose.yml (dev: hot reload, mailpit, dev Dockerfile target)
# - build/prod.compose.yml (build prod images from local source)
x-default-logging: &default-logging
driver: json-file
options:
max-size: '10m'
max-file: '5'
services:
postgres:
image: postgres:18-alpine
restart: unless-stopped
logging: *default-logging
volumes:
- pgdata:/var/lib/postgresql
environment:
POSTGRES_DB: article30
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
ports:
- '127.0.0.1:5432:5432'
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${DB_USER} -d article30']
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:8.6-alpine
restart: unless-stopped
logging: *default-logging
command: ['redis-server', '--requirepass', '${REDIS_PASSWORD}']
ports:
- '127.0.0.1:6379:6379'
healthcheck:
test: ['CMD', 'redis-cli', '-a', '${REDIS_PASSWORD}', 'ping']
interval: 10s
timeout: 5s
retries: 5
rustfs:
image: rustfs/rustfs:1.0.0-alpha.93
restart: unless-stopped
logging: *default-logging
command: server /data --console-address ":9001"
environment:
RUSTFS_ACCESS_KEY: ${S3_ACCESS_KEY}
RUSTFS_SECRET_KEY: ${S3_SECRET_KEY}
volumes:
- rustfsdata:/data
ports:
- '127.0.0.1:9000:9000'
- '127.0.0.1:9001:9001'
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/health']
interval: 10s
timeout: 5s
retries: 5
backend:
image: ghcr.io/ipsec-dev/article30/backend:${ARTICLE30_VERSION:-latest}
env_file:
- path: .env.prod
required: false
restart: unless-stopped
logging: *default-logging
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
rustfs:
condition: service_healthy
environment: &backend-env
DATABASE_URL: postgresql://${DB_USER}:${DB_PASSWORD}@postgres:5432/article30
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
SESSION_SECRET: ${SESSION_SECRET}
CORS_ORIGIN: ${CORS_ORIGIN}
NODE_ENV: ${NODE_ENV}
COOKIE_SECURE: ${COOKIE_SECURE}
S3_ENDPOINT: http://rustfs:9000
S3_BUCKET: article30-documents
S3_ACCESS_KEY: ${S3_ACCESS_KEY}
S3_SECRET_KEY: ${S3_SECRET_KEY}
LOG_LEVEL: ${LOG_LEVEL:-}
LOG_PRETTY: ${LOG_PRETTY:-}
LOG_HTTP: ${LOG_HTTP:-true}
ports:
- '127.0.0.1:3001:3001'
healthcheck:
test: ['CMD-SHELL', 'wget -qO- http://127.0.0.1:3001/health > /dev/null 2>&1 || exit 1']
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
frontend:
image: ghcr.io/ipsec-dev/article30/frontend:${ARTICLE30_VERSION:-latest}
env_file:
- path: .env.prod
required: false
restart: unless-stopped
logging: *default-logging
depends_on:
backend:
condition: service_healthy
environment:
BACKEND_URL: http://backend:3001
ports:
- '127.0.0.1:3000:3000'
# Admin / one-off operations. Not started by `compose up` (profiles: [admin]).
# Pinned to ARTICLE30_VERSION so admin tooling stays in lockstep with the
# backend's prisma schema. Run with:
# docker compose --env-file .env.prod --profile admin run --rm \
# -e ALLOW_SEED=1 backend-tools seed
# docker compose --env-file .env.prod --profile admin run --rm \
# backend-tools password:reset --user user@example.com
backend-tools:
image: ghcr.io/ipsec-dev/article30/backend-tools:${ARTICLE30_VERSION:-latest}
profiles: [admin]
env_file:
- path: .env.prod
required: false
logging: *default-logging
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
rustfs:
condition: service_healthy
environment: *backend-env
restart: 'no'
volumes:
pgdata:
rustfsdata: