Files
Agent-System/deploy/app/Dockerfile
T
weichenandCursor e04829ee8e fix(template): embed official doc templates for container cwd
App images have no templates/ checkout, so GetDocTemplate fell back to a two-section stub and prelim_design lost its real contract.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 19:09:48 +00:00

47 lines
1.2 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
COPY templates /app/templates
COPY configs /app/configs
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"]