-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
60 lines (57 loc) · 1.5 KB
/
docker-compose.dev.yml
File metadata and controls
60 lines (57 loc) · 1.5 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
services:
# 后端服务
backend:
image: python:3.13-slim
container_name: archivenote-backend-dev
working_dir: /app
ports:
- "2601:2601"
volumes:
- ./api:/app
environment:
- SECRET_KEY=dev-secret-key-change-in-production
- DATABASE_URL=postgresql+asyncpg://postgres:postgres@postgres:5432/archivenote
command: >
bash -c "pip install uv &&
uv sync &&
uv run python -m alembic upgrade head &&
uv run python -m uvicorn app.app:app --host 0.0.0.0 --port 2601 --reload"
restart: unless-stopped
networks:
- archivenote-network
# 前端服务
frontend:
image: node:24-alpine
container_name: archivenote-frontend-dev
working_dir: /app
ports:
- "5173:5173"
volumes:
- ./web:/app
- /app/node_modules
environment:
- VITE_API_BASE_URL=http://localhost:2601/api
command: sh -c "npm install && npm run dev -- --host"
restart: unless-stopped
networks:
- archivenote-network
postgres:
image: postgres:17
container_name: archivenote-postgres
restart: always
ports:
- 5432:5432
environment:
POSTGRES_DB: archivenote
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: [ 'CMD', 'pg_isready', '-U', 'postgres', '-d', 'archivenote' ]
interval: 5s
timeout: 10s
retries: 5
networks:
- archivenote-network
networks:
archivenote-network:
driver: bridge