-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (32 loc) · 960 Bytes
/
Dockerfile
File metadata and controls
47 lines (32 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM node:22-alpine AS ui-build
WORKDIR /src/ui
COPY ui/package.json ui/pnpm-lock.yaml ./
RUN corepack enable && pnpm install --frozen-lockfile
COPY ui/ ./
RUN pnpm build
FROM golang:1.26-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
COPY --from=ui-build /src/ui/out /src/internal/uiassets/out
ARG VERSION=dev
RUN CGO_ENABLED=0 GOOS=linux go build \
-tags ui_embed \
-trimpath \
-ldflags="-s -w -X main.Version=${VERSION}" \
-o /out/gateflow \
./cmd/gateflow
FROM alpine:3.22
RUN addgroup -S gateflow \
&& adduser -S -G gateflow gateflow \
&& mkdir -p /etc/gateflow /var/lib/gateflow \
&& chown -R gateflow:gateflow /var/lib/gateflow
COPY --from=build /out/gateflow /usr/local/bin/gateflow
COPY config.docker.yaml /etc/gateflow/config.yaml
USER gateflow
EXPOSE 8080
VOLUME ["/var/lib/gateflow"]
ENV GATEFLOW_CONFIG=/etc/gateflow/config.yaml
ENTRYPOINT ["gateflow"]
CMD ["serve"]