-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdocker-compose.yaml
55 lines (53 loc) · 1.27 KB
/
docker-compose.yaml
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
version: "3.3"
services:
aiproxy:
build:
context: .
dockerfile: Dockerfile
container_name: aiproxy
restart: unless-stopped
depends_on:
pgsql:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "3000:3000/tcp"
environment:
- ADMIN_KEY=aiproxy
- LOG_DETAIL_STORAGE_HOURS=1
- TZ=Asia/Shanghai
- SQL_DSN=postgres://postgres:aiproxy@pgsql:5432/aiproxy
- REDIS_CONN_STRING=redis://redis
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
interval: 5s
timeout: 5s
retries: 10
pgsql:
image: "postgres:latest"
restart: unless-stopped
container_name: postgres
volumes:
- ./pgsql:/var/lib/postgresql/data
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_DB: aiproxy
POSTGRES_PASSWORD: aiproxy
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: "redis:latest"
container_name: redis
restart: unless-stopped
volumes:
- ./redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10