forked from james-6-23/codex2api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (66 loc) · 1.62 KB
/
docker-compose.yml
File metadata and controls
71 lines (66 loc) · 1.62 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
name: codex2api
services:
codex2api:
image: ghcr.io/james-6-23/codex2api:latest
container_name: codex2api
ports:
- "${CODEX_PORT:-8080}:${CODEX_PORT:-8080}"
env_file:
- .env
volumes:
- ./logs:/app/logs
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
networks:
- codex2api-net
postgres:
image: postgres:18-alpine
container_name: codex2api-postgres
environment:
POSTGRES_USER: ${DATABASE_USER:-codex2api}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-codex2api}
POSTGRES_DB: ${DATABASE_NAME:-codex2api}
PGDATA: /var/lib/postgresql/data
TZ: ${TZ:-Asia/Shanghai}
volumes:
- pgdata:/var/lib/postgresql/data
# ports:
# - "5432:5432" # 取消注释以便本地调试
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER:-codex2api}"]
interval: 5s
timeout: 3s
retries: 5
restart: unless-stopped
networks:
- codex2api-net
redis:
image: redis:7-alpine
container_name: codex2api-redis
command: redis-server --appendonly yes
environment:
TZ: ${TZ:-Asia/Shanghai}
volumes:
- redisdata:/data
# ports:
# - "6379:6379" # 取消注释以便本地调试
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
restart: unless-stopped
networks:
- codex2api-net
networks:
codex2api-net:
driver: bridge
volumes:
pgdata:
name: codex2api_pgdata
redisdata:
name: codex2api_redisdata