Repository navigation
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
88 lines (82 loc) · 2.26 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
88 lines (82 loc) · 2.26 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
# Production setup for one server. Run with:
# docker compose -f docker-compose.prod.yml --env-file .env.prod up -d --build
# Caddy gets HTTPS certificates automatically. Only ports 80 and 443 are open to the internet.
name: tradecore
services:
postgres:
image: postgres:17
restart: unless-stopped
environment:
POSTGRES_USER: trading
POSTGRES_PASSWORD: ${DB_PASSWORD:?set DB_PASSWORD in .env.prod}
POSTGRES_DB: paper_trading
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U trading -d paper_trading"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:8
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
backend:
build:
context: .
dockerfile: backend/Dockerfile
restart: unless-stopped
environment:
PORT: 3000
DB_HOST: postgres
DB_PORT: 5432
DB_USER: trading
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: paper_trading
DATABASE_URL: postgresql://trading:${DB_PASSWORD}@postgres:5432/paper_trading
REDIS_HOST: redis
REDIS_PORT: 6379
JWT_SECRET: ${JWT_SECRET:?set JWT_SECRET in .env.prod}
APP_URL: https://${APP_DOMAIN:?set APP_DOMAIN in .env.prod}
CORS_ORIGINS: https://${APP_DOMAIN}
TRUST_PROXY: "true"
MARKET_MAKER_ENABLED: "true"
REQUIRE_EMAIL_VERIFICATION: "true"
BREVO_API_KEY: ${BREVO_API_KEY:-}
BREVO_SENDER_EMAIL: ${BREVO_SENDER_EMAIL:-}
BREVO_SENDER_NAME: ${BREVO_SENDER_NAME:-TradeCore}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
frontend:
build:
context: ./frontend
args:
VITE_API_URL: https://${API_DOMAIN:?set API_DOMAIN in .env.prod}
restart: unless-stopped
caddy:
image: caddy:2
restart: unless-stopped
ports:
- "80:80"
- "443:443"
environment:
APP_DOMAIN: ${APP_DOMAIN}
API_DOMAIN: ${API_DOMAIN}
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
depends_on:
- backend
- frontend
volumes:
pgdata:
caddy_data:
caddy_config: