refactor: split backend into standalone server project
Remove embedded frontend and workflow editor assets, add standalone API deployment configuration, and retain the current backend service updates.
This commit is contained in:
+2
-27
@@ -1,28 +1,5 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
FROM node:24-alpine AS flowgram-editor-builder
|
||||
WORKDIR /src/flowgram-editor
|
||||
|
||||
RUN corepack enable && corepack prepare pnpm@10.30.2 --activate
|
||||
COPY flowgram-editor/package.json flowgram-editor/pnpm-lock.yaml ./
|
||||
RUN --mount=type=cache,target=/root/.local/share/pnpm/store \
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
COPY flowgram-editor/ ./
|
||||
RUN pnpm build
|
||||
|
||||
FROM node:24-alpine AS web-builder
|
||||
WORKDIR /src/web
|
||||
|
||||
RUN corepack enable && corepack prepare pnpm@10.30.2 --activate
|
||||
COPY web/package.json web/pnpm-lock.yaml web/pnpm-workspace.yaml ./
|
||||
RUN --mount=type=cache,target=/root/.local/share/pnpm/store \
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
COPY web/ ./
|
||||
COPY --from=flowgram-editor-builder /src/web/public/flowgram-editor ./public/flowgram-editor
|
||||
RUN pnpm build:sdk && pnpm build
|
||||
|
||||
FROM golang:1.26-alpine AS server-builder
|
||||
WORKDIR /src
|
||||
|
||||
@@ -32,7 +9,6 @@ RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
go mod download
|
||||
|
||||
COPY . ./
|
||||
COPY --from=web-builder /src/web/out ./web/out
|
||||
|
||||
ARG TARGETOS=linux
|
||||
ARG TARGETARCH
|
||||
@@ -57,7 +33,6 @@ RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
go mod download
|
||||
|
||||
COPY . ./
|
||||
COPY --from=web-builder /src/web/out ./web/out
|
||||
|
||||
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
--mount=type=cache,target=/root/.cache/go-build \
|
||||
@@ -106,7 +81,7 @@ EXPOSE 8083
|
||||
VOLUME ["/app/data"]
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
||||
CMD wget -qO- http://127.0.0.1:8083/ >/dev/null || exit 1
|
||||
CMD wget -qO- http://127.0.0.1:8083/api/health >/dev/null || exit 1
|
||||
|
||||
CMD ["/app/agent-desk", "-config", "/app/config/config.yaml"]
|
||||
|
||||
@@ -126,6 +101,6 @@ EXPOSE 8083
|
||||
VOLUME ["/app/data"]
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
||||
CMD wget -qO- http://127.0.0.1:8083/ >/dev/null || exit 1
|
||||
CMD wget -qO- http://127.0.0.1:8083/api/health >/dev/null || exit 1
|
||||
|
||||
CMD ["/app/agent-desk", "-config", "/app/config/config.yaml"]
|
||||
|
||||
Reference in New Issue
Block a user