Updates for dockerfile

This commit is contained in:
9seconds
2020-05-19 11:26:08 +03:00
parent ad7acee64d
commit dbd3d3c266
+6 -8
View File
@@ -1,7 +1,7 @@
############################################################################### ###############################################################################
# BUILD STAGE # BUILD STAGE
FROM golang:1.14-alpine FROM golang:1.14-alpine AS build
RUN set -x \ RUN set -x \
&& apk --no-cache --update add \ && apk --no-cache --update add \
@@ -13,9 +13,9 @@ RUN set -x \
upx upx
COPY . /go/src/github.com/9seconds/mtg/ COPY . /go/src/github.com/9seconds/mtg/
WORKDIR /go/src/github.com/9seconds/mtg
RUN set -x \ RUN set -x \
&& cd /go/src/github.com/9seconds/mtg \
&& make -j 4 static \ && make -j 4 static \
&& upx --ultra-brute -qq ./mtg && upx --ultra-brute -qq ./mtg
@@ -26,11 +26,9 @@ RUN set -x \
FROM scratch FROM scratch
ENTRYPOINT ["/mtg"] ENTRYPOINT ["/mtg"]
ENV MTG_IP=0.0.0.0 \ ENV MTG_BIND=0.0.0.0:3128 \
MTG_PORT=3128 \ MTG_STATS_BIND=0.0.0.0:3129
MTG_STATS_IP=0.0.0.0 \
MTG_STATS_PORT=3129
EXPOSE 3128 3129 EXPOSE 3128 3129
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=0 /go/src/github.com/9seconds/mtg/mtg /mtg COPY --from=build /go/src/github.com/9seconds/mtg/mtg /mtg