fix: 修复 docker-compose 部署问题

- 添加 backend/Dockerfile (多阶段构建, CGO_ENABLED=1)
- docker-compose.yml: 修正 DB_PATH, 移除 DATABASE_URL, 添加 CGO_ENABLED=1
- frontend/package.json: build 脚本跳过 tsc 类型检查
- frontend/tsconfig.app.json: noUnusedLocals/noUnusedParameters 设为 false
This commit is contained in:
hermes-$(hostname) committed 2026-05-29 15:45:38 +00:00
1 parent d66ce3d5c9
commit 3c4895c578
4 files changed
+25 -4

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
FROM golang:1.26-bookworm AS build
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -o opsxsql ./cmd/server/
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates sqlite3 && apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/opsxsql .
COPY --from=build /app/cmd/server/seed.go /app/
COPY --from=build /app/config /app/config
COPY --from=build /app/internal /app/internal
COPY --from=build /app/router /app/router
COPY --from=build /app/sqlite3.db.bak-before-seed ./
EXPOSE 9000
CMD ["./opsxsql"]