forked from QuantumNous/new-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
73 lines (68 loc) · 1.66 KB
/
docker-compose.dev.yml
File metadata and controls
73 lines (68 loc) · 1.66 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
# Frontend Development - Backend built from local source
#
# Usage:
# 1. docker compose -f docker-compose.dev.yml up -d
# 2. cd web && bun install && bun run dev
# 3. Open http://localhost:3001 (Rsbuild dev server, API auto-proxied to :3000)
#
# Rebuild backend after Go code changes:
# docker compose -f docker-compose.dev.yml up -d --build new-api
#
# Stop:
# docker compose -f docker-compose.dev.yml down
#
# Reset data:
# docker compose -f docker-compose.dev.yml down -v
services:
new-api:
build:
context: .
dockerfile: Dockerfile.dev
image: new-api-dev:local
container_name: new-api-dev
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- dev_data:/data
environment:
- SQL_DSN=postgresql://root:123456@postgres:5432/new-api
- REDIS_CONN_STRING=redis://redis
- TZ=Asia/Shanghai
- BATCH_UPDATE_ENABLED=true
depends_on:
redis:
condition: service_started
postgres:
condition: service_healthy
networks:
- dev-network
redis:
image: redis:7-alpine
container_name: new-api-dev-redis
restart: unless-stopped
networks:
- dev-network
postgres:
image: postgres:15-alpine
container_name: new-api-dev-pg
restart: unless-stopped
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: 123456
POSTGRES_DB: new-api
volumes:
- dev_pg_data:/var/lib/postgresql/data
networks:
- dev-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U root -d new-api"]
interval: 5s
timeout: 3s
retries: 5
volumes:
dev_data:
dev_pg_data:
networks:
dev-network:
driver: bridge