-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
34 lines (26 loc) · 850 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
FROM node:alpine as frontend
WORKDIR /app
COPY frontend/package.json /app
COPY frontend/package-lock.json /app
RUN npm install
COPY frontend /app
RUN npm run build
FROM cgr.dev/chainguard/go:latest as build
ARG ARCH=amd64
WORKDIR /work
COPY go.mod /work
COPY go.sum /work
RUN go mod download
COPY ./cmd /work/cmd
COPY ./pkg /work/pkg
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
go build -o enterprise-gtm-starter ./cmd/enterprise-gtm-starter
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
go build -o preflight-config ./cmd/preflight-config
FROM cgr.dev/chainguard/static:latest
COPY --from=build /work/enterprise-gtm-starter /enterprise-gtm-starter
COPY --from=build /work/preflight-config /preflight-config
COPY --from=frontend /app/build /frontend
ENV STATIC_DIR="/frontend"
ENV GIN_ADDRESS=":8888"
CMD ["/enterprise-gtm-starter"]