Repository navigation
Expand file tree
/
Copy pathcompose.prod.yaml
More file actions
69 lines (63 loc) · 2.1 KB
/
Copy pathcompose.prod.yaml
File metadata and controls
69 lines (63 loc) · 2.1 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
name: type-fast
# Production layout for a single host: images come from GHCR, nothing is built
# locally, and only the reverse proxy can reach the API port. Copy this file and
# .env.production to /srv/type-fast on the host.
services:
db:
image: postgres:18-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:?set POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB:?set POSTGRES_DB}
volumes:
- kit-postgres:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 20
# Carries revocation news between the API and any future instance. It holds
# nothing durable, so persistence is off and the whole dataset may be evicted:
# a miss only means an instance waits for its next refresh.
redis:
image: redis:8-alpine
restart: unless-stopped
command: ["redis-server", "--save", "", "--appendonly", "no", "--maxmemory", "64mb", "--maxmemory-policy", "allkeys-lru"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
migrate:
image: ghcr.io/andiewitz/type-fast-user:${IMAGE_TAG:?set IMAGE_TAG}
entrypoint: ["/app/migrate"]
command: ["up"]
restart: "no"
environment:
DATABASE_URL: ${DATABASE_URL:?set DATABASE_URL}
depends_on:
db:
condition: service_healthy
user:
image: ghcr.io/andiewitz/type-fast-user:${IMAGE_TAG:?set IMAGE_TAG}
restart: unless-stopped
env_file:
- .env.production
environment:
APP_ENV: production
PORT: "3001"
DATABASE_URL: ${DATABASE_URL:?set DATABASE_URL}
METRICS_ADDR: 127.0.0.1:9091
REVOCATION_BUS: ${REVOCATION_BUS:-none}
REDIS_URL: ${REDIS_URL:-redis://redis:6379/0}
REVOCATION_CHANNEL: ${REVOCATION_CHANNEL:-kit:revocations}
ports:
- "127.0.0.1:3001:3001"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
volumes:
kit-postgres: