Unify auth middleware and remove X-User-ID trust, add project_members authorization, sandbox workspaces via resolver, and admin-only reconcile by run_id. Introduce goose migrations with startup schema gate, fail closed when DB unavailable outside explicit ALLOW_IN_MEMORY, bundle web/dist in app Dockerfile, and remove frontend pseudo-login fallback.
45 lines
1.1 KiB
Docker
45 lines
1.1 KiB
Docker
# =============================================================================
|
|
# Go API Server + React SPA (agent-dev / agent-test / agent-main)
|
|
# =============================================================================
|
|
FROM node:22-bookworm AS web-builder
|
|
|
|
WORKDIR /web
|
|
COPY web/package.json web/package-lock.json* ./
|
|
RUN npm ci
|
|
COPY web/ ./
|
|
RUN npm run build
|
|
|
|
FROM golang:1.23-bookworm AS go-builder
|
|
|
|
ENV GOTOOLCHAIN=auto
|
|
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /server ./cmd/server
|
|
|
|
FROM debian:bookworm-slim
|
|
|
|
RUN set -eux; \
|
|
apt-get update; \
|
|
apt-get install -y --no-install-recommends ca-certificates curl; \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
COPY --from=go-builder /server /app/server
|
|
COPY --from=web-builder /web/dist /app/web/dist
|
|
COPY deploy/postgres/goose /app/deploy/postgres/goose
|
|
|
|
ENV DATA_DIR=/app/data \
|
|
HTTP_HOST=0.0.0.0 \
|
|
HTTP_PORT=8080
|
|
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=10s --timeout=5s --retries=6 \
|
|
CMD curl -fsS "http://127.0.0.1:${HTTP_PORT:-8080}/api/v1/health" || exit 1
|
|
|
|
ENTRYPOINT ["/app/server"]
|
|
CMD ["-env", "/dev/null"]
|