Docker

Estimated reading time: less than 1 minute 预计阅读时间: 小于 1 分钟

Detailed walkthrough (Chinese) at /guide/start/docker. The English version below covers the essentials.

The repo's docker-compose.yml provisions four services:

ServiceImagePortPurpose
postgrespostgres:17-alpine5432Primary store
redisredis:7-alpine6379Session / cache / rate limit
rustfsrustfs/rustfs:latest9000 / 9001S3-compatible storage
appmulti-stage build → summerrs-admin:latest8080Main app

1. .env

POSTGRES_PASSWORD=replace
JWT_SECRET=replace-64-chars
S3_ACCESS_KEY=summerAK
S3_SECRET_KEY=summerSK
S3_ENDPOINT=http://rustfs:9000
S3_BUCKET=summer-admin
RUST_LOG=info

2. Start

docker compose up -d --build
docker compose logs -f app
docker compose ps

3. Initialize DB

psql -h localhost -U admin -d summerrs-admin -f sql/sys/user.sql
# repeat for the rest of sql/sys/*.sql, sql/ai/*.sql, sql/tenant/*.sql

4. Verify

curl http://localhost:8080/docs                                     # OpenAPI
curl -X POST http://localhost:8080/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"Admin","password":"123456"}'

Maintenance

docker compose down              # stop
docker compose down -v           # ⚠️ wipe volumes
docker compose restart app       # restart only the app
docker compose build app         # rebuild app image