-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (24 loc) · 837 Bytes
/
Dockerfile
File metadata and controls
39 lines (24 loc) · 837 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
FROM node:24 AS frontend-builder
WORKDIR /app/ui
COPY ui /app/ui
RUN npm install -g npm@latest && \
npm install --force
RUN npm run build
FROM golang:1.24 AS backend-builder
WORKDIR /app
ARG VERSION=dev
ARG BUILD_DATE=unknown
ARG COMMIT_SHA=unknown
COPY . .
RUN go mod tidy && \
go mod download
COPY --from=frontend-builder /app/ui/dist /app/ui/dist
RUN rm -rf ./internal/web/static/* && \
mv ./ui/dist/* ./internal/web/static/
ENV CGO_ENABLED=0
RUN go build \
-ldflags="-s -w -X github.com/pehlicd/crd-wizard/cmd.versionString=${VERSION} -X github.com/pehlicd/crd-wizard/cmd.buildDate=${BUILD_DATE} -X github.com/pehlicd/crd-wizard/cmd.buildCommit=${COMMIT_SHA}" \
-o crd-wizard
FROM alpine:3.22.1
COPY --from=backend-builder /app/crd-wizard /usr/local/bin/crd-wizard
ENTRYPOINT ["crd-wizard", "web"]