From 26841b4384b4e8c4868c5b8d2e60739d3898e32c Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 21 Jul 2026 22:17:21 +0800 Subject: [PATCH] feat: add standalone Dockerfile with frontend and backend --- Dockerfile.standalone | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Dockerfile.standalone diff --git a/Dockerfile.standalone b/Dockerfile.standalone new file mode 100644 index 0000000..27e1744 --- /dev/null +++ b/Dockerfile.standalone @@ -0,0 +1,39 @@ +# Build frontend +FROM node:22-alpine AS frontend-builder +WORKDIR /app/web +COPY web/package.json web/pnpm-lock.yaml ./ +RUN npm install -g pnpm && pnpm install --frozen-lockfile +COPY web/ . +RUN pnpm build + +# Build backend +FROM golang:1.24-alpine AS backend-builder +WORKDIR /app +RUN apk add --no-cache git +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -o /taskpool . + +# Production stage +FROM alpine:3.19 +RUN apk add --no-cache nginx supervisor + +# Copy frontend +COPY --from=frontend-builder /app/web/dist /usr/share/nginx/html + +# Copy backend +COPY --from=backend-builder /taskpool /app/taskpool + +# Copy nginx config (modified for localhost) +COPY nginx-standalone.conf /etc/nginx/http.d/default.conf + +# Copy supervisor config +COPY supervisord.conf /etc/supervisord.conf + +# Create data directories +RUN mkdir -p /app/data /app/configs /app/envs /app/logs + +EXPOSE 3000 8052 + +CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]