-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (27 loc) · 938 Bytes
/
Dockerfile
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
# Build the frontend
FROM node:18 as builder
ARG CONFIGURATION="production"
ARG GITHUB_TOKEN
WORKDIR /app/ui
COPY ui/.npmrc ui/package.json ui/pnpm-lock.yaml ./
RUN --mount=type=secret,id=github_token \
export GITHUB_TOKEN="$(cat /run/secrets/github_token)" && npx pnpm install && npx pnpm install pnpm
RUN npx browserslist@latest --update-db
COPY ./ui .
RUN echo "Building frontend in configuration $CONFIGURATION"
RUN npx ng build --configuration $CONFIGURATION && rm -r .angular/cache node_modules
# Build cisd
FROM golang:1.23 as build
RUN update-ca-certificates
WORKDIR /go/src/app
COPY go.mod .
ENV GO111MODULE=on
RUN go mod download
RUN go mod verify
COPY . .
COPY --from=builder /app/cmds/cisd/ui /go/src/app/cmds/cisd/ui
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /go/bin/cisd ./cmds/cisd
FROM gcr.io/distroless/base
COPY --from=build /go/bin/cisd /go/bin/cisd
EXPOSE 3000
ENTRYPOINT ["/go/bin/cisd"]