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
146 lines (138 loc) · 4.56 KB
/
docker-compose.prod.yml
File metadata and controls
146 lines (138 loc) · 4.56 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
# ═══════════════════════════════════════════════════════════
# 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
- AGENT_SERVICE_URL=http://paypol-agents:3001
- DAEMON_PRIVATE_KEY=${DAEMON_PRIVATE_KEY:-0x3a573b684c573b069719efebf714c021ac4f6f8480aa397375fe58fa16b93eae}
expose:
- "3000"
networks:
- paypol-net
- coolify
depends_on:
db:
condition: service_healthy
agents:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# ── Agent Service (32 on-chain agents) ───────────────────
agents:
build:
context: ./services/agents
dockerfile: Dockerfile
container_name: paypol-agents
restart: always
environment:
- NODE_ENV=production
- AGENT_SERVICE_PORT=3001
- DAEMON_PRIVATE_KEY=${DAEMON_PRIVATE_KEY:-0x3a573b684c573b069719efebf714c021ac4f6f8480aa397375fe58fa16b93eae}
expose:
- "3001"
networks:
- paypol-net
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3001/health"]
interval: 15s
timeout: 5s
retries: 3
start_period: 15s
# ── ZK Daemon (Proof Generator + Escrow Settler) ────────
daemon:
build:
context: ./services/daemon
dockerfile: Dockerfile
container_name: paypol-daemon
restart: always
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://paypol:paypol_production_2024@db:5432/paypol_core
- DAEMON_PRIVATE_KEY=${DAEMON_PRIVATE_KEY:-0x3a573b684c573b069719efebf714c021ac4f6f8480aa397375fe58fa16b93eae}
- SHIELD_V2_ADDRESS=0x3B4b47971B61cB502DD97eAD9cAF0552ffae0055
- NEXUS_V2_ADDRESS=0x6A467Cd4156093bB528e448C04366586a1052Fab
networks:
- paypol-net
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "pgrep", "-f", "daemon.ts"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# ── 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
coolify:
external: true