forked from Alevsk/console
-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (29 loc) · 836 Bytes
/
Dockerfile
File metadata and controls
46 lines (29 loc) · 836 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
ARG GO_VERSION=1.26
ARG NODE_VERSION=24
FROM node:${NODE_VERSION}-alpine AS uilayer
WORKDIR /app
# Git is required for some dependencies pulled from repositories
RUN apk add --no-cache git
RUN corepack enable
COPY ./web-app/package.json ./web-app/yarn.lock ./web-app/.yarnrc.yml ./
RUN yarn install
COPY ./web-app .
RUN yarn build
USER node
FROM golang:${GO_VERSION}-alpine AS golayer
WORKDIR /console/
ADD go.mod .
ADD go.sum .
# Get dependencies - will also be cached if we won't change mod/sum
RUN go mod download
ADD . .
ENV CGO_ENABLED=0
ENV GO111MODULE=on
COPY --from=uilayer /app/build ./web-app/build
RUN go build -trimpath --tags=kqueue,operator -ldflags "-w -s" -a -o console ./cmd/console
FROM scratch
EXPOSE 9090
COPY --from=golayer /console/console .
USER 1000:1000
ENTRYPOINT ["/console"]
CMD [ "server"]