-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
50 lines (36 loc) · 888 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
43
44
45
46
47
48
49
50
# GO_BUILD
FROM golang:alpine AS GO_BUILD
ARG version
ARG buildTime
ARG rev
WORKDIR /app
COPY ./ /app
ENV CGO_ENABLED 0
ENV GOARCH amd64
ENV GOOS linux
RUN go build \
-a \
-ldflags="-w -s -X main.Version=$version -X main.Rev=$rev -X main.BuildTime=$buildTime" \
-o app \
"github.com/romnn/ldap-manager/cmd/ldap-manager"
# NODE_BUILD
FROM node:18 AS NODE_BUILD
ARG version
ARG branding=true
ENV VITE_APP_VERSION=$version
ENV VITE_BRANDING=$branding
WORKDIR /app
COPY ./ /app
RUN cd web && yarn install --dev && yarn build
# FINAL
FROM gcr.io/distroless/static
LABEL maintainer="[email protected]"
USER nonroot:nonroot
COPY --from=GO_BUILD --chown=nonroot:nonroot /app/app /app
COPY --from=NODE_BUILD --chown=nonroot:nonroot /app/web/dist /web/dist
ENV STATIC_ROOT /web/dist
ENV HTTP_PORT 8080
ENV GRPC_PORT 9090
EXPOSE 8080
EXPOSE 9090
ENTRYPOINT [ "/app", "serve" ]