From 3e7eefb0f2a641581d5b26d66543974868650599 Mon Sep 17 00:00:00 2001 From: mimimix Date: Tue, 16 Jan 2024 00:33:55 +0300 Subject: [PATCH] hi server update --- apps/hiserver/Dockerfile | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/apps/hiserver/Dockerfile b/apps/hiserver/Dockerfile index ea77cd0..ebfbe01 100644 --- a/apps/hiserver/Dockerfile +++ b/apps/hiserver/Dockerfile @@ -1,32 +1,40 @@ -FROM golang:alpine AS builder - -LABEL stage=gobuilder - -ENV CGO_ENABLED 0 +#FROM golang:alpine AS builder +# +#LABEL stage=gobuilder +# +# +#RUN apk update --no-cache && apk add --no-cache tzdata +# +#WORKDIR /build +# +# +#ADD go.sum . -ENV GOOS linux +FROM base:go_builder as builder RUN apk update --no-cache && apk add --no-cache tzdata +ARG PATH_TO_MAIN=default_value WORKDIR /build -ADD go.mod . - -#ADD go.sum . - +ADD $PATH_TO_MAIN/go.mod . +ADD $PATH_TO_MAIN/go.sum . RUN go mod download COPY . . -RUN go build -ldflags="-s -w" -o /app/main ./main.go +ENV CGO_ENABLED 0 +ENV GOOS linux + +RUN go build -ldflags="-s -w" -o /app/main $PATH_TO_MAIN/main.go FROM alpine RUN apk update --no-cache && apk add --no-cache ca-certificates -COPY --from=builder /usr/share/zoneinfo/America/New_York /usr/share/zoneinfo/America/New_York +COPY --from=builder /usr/share/zoneinfo/Europe/Moscow /usr/share/zoneinfo/Europe/Moscow -ENV TZ America/New_York +ENV TZ Europe/Moscow WORKDIR /app