forked from MiloChiang/paypol-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
92 lines (86 loc) · 2.83 KB
/
docker-compose.prod.yml
File metadata and controls
92 lines (86 loc) · 2.83 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
# ═══════════════════════════════════════════════════════════
# PayPol Protocol — Production Docker Compose
# Domain: paypol.xyz | VPS: 37.27.190.158 (Hetzner)
# ═══════════════════════════════════════════════════════════
services:
# ── PostgreSQL Database ────────────────────────────────
db:
image: postgres:16-alpine
container_name: paypol-db
restart: always
environment:
POSTGRES_USER: paypol
POSTGRES_PASSWORD: paypol_production_2024
POSTGRES_DB: paypol_core
volumes:
- pgdata:/var/lib/postgresql/data
expose:
- "5432"
networks:
- paypol-net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U paypol -d paypol_core"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# ── Dashboard (Next.js 16) ──────────────────────────────
dashboard:
build:
context: ./apps/dashboard
dockerfile: Dockerfile
container_name: paypol-dashboard
restart: always
env_file:
- ./apps/dashboard/.env.production
environment:
- NODE_ENV=production
- PORT=3000
- HOSTNAME=0.0.0.0
- DATABASE_URL=postgresql://paypol:paypol_production_2024@db:5432/paypol_core
expose:
- "3000"
networks:
- paypol-net
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# ── Nginx (Reverse Proxy + SSL) ─────────────────────────
nginx:
image: nginx:alpine
container_name: paypol-nginx
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./deploy/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./deploy/nginx/conf.d:/etc/nginx/conf.d:ro
- /etc/letsencrypt:/etc/letsencrypt:ro
- /var/www/certbot:/var/www/certbot:ro
depends_on:
dashboard:
condition: service_healthy
networks:
- paypol-net
# ── Certbot (Let's Encrypt SSL) ─────────────────────────
certbot:
image: certbot/certbot
container_name: paypol-certbot
volumes:
- /etc/letsencrypt:/etc/letsencrypt
- /var/www/certbot:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
networks:
- paypol-net
volumes:
pgdata:
networks:
paypol-net:
driver: bridge