-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
116 lines (109 loc) · 2.95 KB
/
docker-compose.yml
File metadata and controls
116 lines (109 loc) · 2.95 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
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: zerohack
POSTGRES_USER: zerohack
POSTGRES_PASSWORD: zerohack_password
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U zerohack"]
interval: 10s
timeout: 5s
retries: 5
# Redis for caching and sessions
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# Backend API
backend:
build:
context: .
dockerfile: backend/Dockerfile
environment:
- ZEROHACK_DATABASE_URL=postgresql+asyncpg://zerohack:zerohack_password@postgres:5432/zerohack
- ZEROHACK_REDIS_URL=redis://redis:6379
- ZEROHACK_SECRET_KEY=your-super-secret-key-change-in-production
- ZEROHACK_BLOCKCHAIN_RPC_URL=http://host.docker.internal:8545
- ZEROHACK_LOGGER_CONTRACT_ADDRESS=0x1234567890123456789012345678901234567890
- ZEROHACK_RESPONSE_CONTRACT_ADDRESS=0x1234567890123456789012345678901234567890
- ZEROHACK_DAO_CONTRACT_ADDRESS=0x1234567890123456789012345678901234567890
- ZEROHACK_SENDER_ACCOUNT_ADDRESS=0x1234567890123456789012345678901234567890
- ZEROHACK_SENDER_PRIVATE_KEY=your-private-key-here
- ZEROHACK_SMTP_SERVER=smtp.gmail.com
- ZEROHACK_SMTP_PORT=587
- ZEROHACK_SMTP_USERNAME=your-email@gmail.com
- ZEROHACK_SMTP_PASSWORD=your-app-password
- ZEROHACK_ALERT_EMAIL=admin@zerohack.local
- ZEROHACK_BASE_URL=http://localhost:3000
ports:
- "8008:8008"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./backend:/app/backend
- ./models:/app/models
- ./blockchain:/app/blockchain
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8008/health"]
interval: 30s
timeout: 10s
retries: 3
# Frontend
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
environment:
- NEXT_PUBLIC_API_BASE_URL=http://localhost:8008
ports:
- "3000:3000"
depends_on:
- backend
volumes:
- ./frontend:/app
- /app/node_modules
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
# Nginx reverse proxy
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./ssl:/etc/nginx/ssl
depends_on:
- frontend
- backend
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3
volumes:
postgres_data:
redis_data:
networks:
default:
name: zerohack_network