文件
hyb-oa/docker-compose.yml
T
wangsli 89c0ed2ec1 feat(server): 单域托管 client/dist 与 SPA 回退(E12)
- 新增 SERVE_CLIENT_DIST/CLIENT_DIST_DIR 配置
- 开启后注册 @fastify/static 并对非 /api GET(html) 回退 index.html
- docker-compose.yml 与 README 补充用法
2026-02-09 00:06:59 +08:00

45 行
1.1 KiB
YAML

version: '3.8'
services:
db:
image: postgres:15-alpine
container_name: hyb-oa-db
restart: always
environment:
POSTGRES_USER: hyboa_user
POSTGRES_PASSWORD: hyboa_password
POSTGRES_DB: hyb_oa
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
server:
image: node:20-alpine
container_name: hyb-oa-server
restart: unless-stopped
working_dir: /app/server
command: sh -c "npm install && npm run dev"
environment:
DATABASE_URL: "postgresql://hyboa_user:hyboa_password@db:5432/hyb_oa?schema=public"
JWT_SECRET: "change_me"
APP_TIMEZONE: "Asia/Shanghai"
STORAGE_DIR: "generated/storage"
SERVE_CLIENT_DIST: "false"
CLIENT_DIST_DIR: "../client/dist"
SIGNED_URL_TTL_SECONDS: "600"
MAX_UPLOAD_SIZE_BYTES: "10485760"
PORT: "3000"
HOST: "0.0.0.0"
ports:
- "3000:3000"
depends_on:
- db
volumes:
- ./:/app
- server_storage:/app/server/generated/storage
volumes:
postgres_data:
server_storage: