-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
89 lines (84 loc) · 3.17 KB
/
Copy pathdocker-compose.yml
File metadata and controls
89 lines (84 loc) · 3.17 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Docker Compose configuration using pre-built images from Docker Hub
# Usage:
# 1. Create a .env file beside this compose file.
# 2. Set VITE_API_BASE=http://YOUR_SERVER_IP:18000 in .env.
# 3. Set POSTGRES_PASSWORD=change_this_password in .env.
# 4. Run docker compose up -d.
#
# Optional .env values:
# IMAGE_TAG=v1.0.0
# IMAGE_TAG=develop
# POSTGRES_IMAGE=postgres:17
# Compatibility-only path. Future Rote versions may require pgvector-capable Postgres.
#
# Available tags:
# - latest: Latest stable release (supports multi-platform: amd64, arm64)
# - release: Latest stable release (same as latest)
# - develop: Latest from develop branch; use this for unreleased features documented on develop
# - main: Latest from main branch
# - v1.0.0: Specific version (if released)
#
# ⚠️ IMPORTANT ⚠️
# Don't forget to set VITE_API_BASE
# Example: VITE_API_BASE=http://YOUR_SERVER_IP:18000 or VITE_API_BASE=https://your-domain.com
# Note: If you use a reverse proxy, VITE_API_BASE should be your backend address after the reverse proxy
services:
rote-backend:
# latest is intentionally the stable default. Use IMAGE_TAG=develop to test
# unreleased features before they are promoted to the stable image.
image: rabithua/rote-backend:${IMAGE_TAG:-latest}
pull_policy: always
container_name: rote-backend
environment:
# 基础配置 - 必需
- POSTGRESQL_URL=postgresql://rote:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env before first start}@rote-postgres:5432/rote
ports:
- "18000:3000"
depends_on:
rote-postgres:
condition: service_healthy
restart: unless-stopped
# Startup command: wait for the database to be ready, then run migrations and start the backend service
# Uses programmatic migrations (does not rely on drizzle-kit CLI, suitable for production)
command:
[
"sh",
"-c",
"sleep 15 && bun run dist/scripts/runMigrations.js && bun run dist/server.js",
]
rote-frontend:
# Keep this tag aligned with rote-backend by using the same IMAGE_TAG value.
image: rabithua/rote-frontend:${IMAGE_TAG:-latest}
pull_policy: always
container_name: rote-frontend
ports:
- "18001:80"
depends_on:
- rote-backend
environment:
- VITE_API_BASE=${VITE_API_BASE:?Set VITE_API_BASE to your public backend URL, for example http://your-domain.com}
restart: unless-stopped
rote-postgres:
# pgvector image keeps Postgres 17 behavior and adds the optional vector extension.
# Plain postgres:17 is a compatibility-only path and may not be supported by future Rote versions.
image: ${POSTGRES_IMAGE:-pgvector/pgvector:pg17-trixie}
container_name: rote-postgres
restart: unless-stopped
environment:
POSTGRES_USER: rote
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env before first start}
POSTGRES_DB: rote
volumes:
- rote-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U rote -d rote"]
interval: 5s
timeout: 3s
retries: 10
start_period: 30s
volumes:
rote-postgres-data:
networks:
default:
name: rote-network
driver: bridge