-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 793 Bytes
/
Dockerfile
File metadata and controls
35 lines (25 loc) · 793 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
FROM node:lts as node
WORKDIR /assets
COPY package.json package-lock.json Gruntfile.js ./
COPY static static
RUN npm ci && npm start
FROM golang:alpine as golang
WORKDIR /go/src/app
COPY . .
RUN CGO_ENABLED=0 go build -o /go/bin/app/maud-bin -ldflags '-extldflags "-static"' ./maud
FROM alpine:latest as alpine
RUN apk --no-cache add tzdata zip ca-certificates
WORKDIR /usr/share/zoneinfo
RUN zip -r -0 /zoneinfo.zip .
FROM scratch
WORKDIR /maud
# Copy most static assets
COPY . .
# Copy executable
COPY --from=golang /go/bin/app/maud-bin /maud/maud-bin
# Copy compiled assets
COPY --from=node /assets/static /maud/static
ENV ZONEINFO /zoneinfo.zip
COPY --from=alpine /zoneinfo.zip /
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT ["/maud/maud-bin"]