-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
124 lines (117 loc) · 3.24 KB
/
Copy pathdocker-compose.yml
File metadata and controls
124 lines (117 loc) · 3.24 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
# CrackHouse Production Docker Compose
# Uses pre-built images from GitHub Container Registry
#
# Quick start:
# 1. Copy .env.example to .env and configure
# 2. Run: docker compose up -d
# 3. Access: http://localhost:3000
services:
# PostgreSQL Database
db:
image: postgres:16-alpine
container_name: crackhouse-db
environment:
POSTGRES_DB: ${POSTGRES_DB:-crackhouse}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- crackhouse-network
# Redis for job queues
redis:
image: redis:7-alpine
container_name: crackhouse-redis
command: redis-server --appendonly yes
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- crackhouse-network
# API Service
api:
image: ghcr.io/doomedramen/crackhouse/api:latest
container_name: crackhouse-api
environment:
NODE_ENV: production
PORT: 3001
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-crackhouse}
REDIS_URL: redis://redis:6379
AUTH_SECRET: ${AUTH_SECRET:?AUTH_SECRET is required (min 32 chars)}
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET is required (min 32 chars)}
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:3000}
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:3000}
ports:
- "3001:3001"
volumes:
- uploads:/app/uploads
- temp:/app/temp
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
restart: unless-stopped
networks:
- crackhouse-network
# Background Worker
worker:
image: ghcr.io/doomedramen/crackhouse/api:latest
container_name: crackhouse-worker
command: ["pnpm", "worker"]
environment:
NODE_ENV: production
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-crackhouse}
REDIS_URL: redis://redis:6379
MAX_CONCURRENT_JOBS: ${MAX_CONCURRENT_JOBS:-2}
volumes:
- uploads:/app/uploads
- temp:/app/temp
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
api:
condition: service_healthy
restart: unless-stopped
networks:
- crackhouse-network
# Web Frontend
web:
image: ghcr.io/doomedramen/crackhouse/web:latest
container_name: crackhouse-web
environment:
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://localhost:3001}
ports:
- "3000:3000"
depends_on:
- api
restart: unless-stopped
networks:
- crackhouse-network
volumes:
postgres_data:
redis_data:
uploads:
temp:
networks:
crackhouse-network:
driver: bridge