Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
87 lines (84 loc) · 2.49 KB
/
Copy pathcompose.yaml
File metadata and controls
87 lines (84 loc) · 2.49 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
services:
postgres:
image: postgres:16-alpine
container_name: xconfess-postgres
environment:
POSTGRES_DB: xconfess
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "55432:5432"
volumes:
- xconfess-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d xconfess"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
container_name: xconfess-redis
ports:
- "6379:6379"
volumes:
- xconfess-redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
# Opt-in containerized backend. Start with:
# docker compose -f compose.yaml --profile app up --build
# Its health status uses the deployed backend readiness contract.
backend:
image: node:20-alpine
container_name: xconfess-backend
profiles: ["app"]
working_dir: /workspace/xconfess-backend
command: >-
sh -c "cd /workspace && npm install --no-package-lock && npm run dev:backend"
environment:
NODE_ENV: development
APP_ENV: local
PORT: "5000"
FRONTEND_URL: http://localhost:3000
DB_HOST: postgres
DB_PORT: "5432"
DB_USERNAME: postgres
DB_PASSWORD: postgres
DB_NAME: xconfess
REDIS_HOST: redis
REDIS_PORT: "6379"
ENABLE_BACKGROUND_JOBS: "true"
TYPEORM_SYNCHRONIZE: "true"
JWT_SECRET: local-development-jwt-secret
APP_SECRET: local-development-app-secret
CONFESSION_ENCRYPTION_KEY: "0000000000000000000000000000000000000000000000000000000000000000"
STELLAR_FEATURES_ENABLED: "false"
STELLAR_SERVER_SECRET: SCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ports:
- "5000:5000"
volumes:
- ./:/workspace
- xconfess-node-modules:/workspace/node_modules
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
# Use Node rather than curl/wget so this works in the stock Node image.
test:
- CMD-SHELL
- >-
node -e "require('http').get('http://localhost:5000/api/health/ready',
response => process.exit(response.statusCode === 200 ? 0 : 1)).on('error',
() => process.exit(1))"
interval: 10s
timeout: 5s
retries: 6
start_period: 45s
volumes:
xconfess-postgres-data:
xconfess-redis-data:
xconfess-node-modules: