-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (46 loc) · 1.03 KB
/
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
51
52
53
54
55
56
57
58
59
60
# # ======================
# # GO FIRST STAGE
# # ======================
# FROM golang:latest as builder
# USER ${USER}
# WORKDIR /usr/src/app
# COPY go.mod \
# go.sum ./
# RUN go mod download
# COPY . ./
# ENV GO111MODULE="on" \
# GOARCH="amd64" \
# GOOS="linux" \
# CGO_ENABLED="0"
# RUN apt-get clean \
# && apt-get remove
# # ======================
# # GO FINAL STAGE
# # ======================
# FROM builder
# WORKDIR /usr/src/app
# RUN apt-get update \
# && apt-get install -y \
# make \
# vim \
# build-essential
# COPY --from=builder . ./usr/src/app
# RUN make goprod
# EXPOSE 3000
# CMD ["./main"]
# Builder
FROM golang:latest as builder
RUN apk update && apk upgrade && \
apk --update add git make
WORKDIR /app
COPY . .
RUN make engine
# Distribution
FROM alpine:latest
RUN apk update && apk upgrade && \
apk --update --no-cache add tzdata && \
mkdir /app
WORKDIR /app
EXPOSE 9090
COPY --from=builder /app/engine /app
CMD /app/engine