-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (53 loc) · 1.39 KB
/
Copy pathdocker-compose.yml
File metadata and controls
57 lines (53 loc) · 1.39 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
version: '3.8'
services:
# PostgreSQL 数据库
postgres:
image: postgres:15-alpine
container_name: codehost-db
restart: unless-stopped
environment:
POSTGRES_USER: codehost
POSTGRES_PASSWORD: codehost_password
POSTGRES_DB: code_hosting
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U codehost -d code_hosting"]
interval: 10s
timeout: 5s
retries: 5
# Next.js 应用
app:
build:
context: .
dockerfile: Dockerfile
container_name: codehost-app
restart: unless-stopped
environment:
DATABASE_URL: postgresql://codehost:codehost_password@postgres:5432/code_hosting
JWT_SECRET: your-super-secret-jwt-key-change-in-production
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: your-nextauth-secret-change-in-production
NEXT_PUBLIC_WS_URL: http://localhost:3001
NEXT_PUBLIC_APP_URL: http://localhost:3000
ports:
- "3000:3000"
depends_on:
postgres:
condition: service_healthy
# WebSocket 服务器
websocket:
build:
context: .
dockerfile: Dockerfile.ws
container_name: codehost-ws
restart: unless-stopped
environment:
WS_PORT: 3001
NEXT_PUBLIC_APP_URL: http://localhost:3000
ports:
- "3001:3001"
volumes:
postgres_data: