forked from dosco/graphjin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (34 loc) · 894 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
# stage: 1
FROM node:16 as react-build
WORKDIR /web
COPY /serv/web/ ./
RUN yarn
RUN yarn build
# stage: 2
FROM golang:1.17 as go-build
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get -y install build-essential git jq upx
RUN go install github.com/rafaelsq/wtc@latest
WORKDIR /app
COPY . /app
RUN mkdir -p /app/serv/web/build
COPY --from=react-build /web/build/ ./serv/web/build
RUN go mod download
RUN make build
# RUN echo "Compressing binary, will take a bit of time..." && \
# upx --ultra-brute -qq graphjin && \
# upx -t graphjin
# stage: 3
FROM alpine:3.14
WORKDIR /
RUN apk add --no-cache tzdata
RUN apk add --no-cache libc6-compat
RUN mkdir -p /config
COPY --from=go-build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=go-build /app/graphjin .
RUN chmod +x /graphjin
#USER nobody
ENV GO_ENV production
ENTRYPOINT ["./graphjin"]
CMD ["serv"]