Skip to content

Commit

Permalink
hi server update
Browse files Browse the repository at this point in the history
  • Loading branch information
mimimix committed Jan 15, 2024
1 parent 7a1d938 commit 3e7eefb
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions apps/hiserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 3e7eefb

Please sign in to comment.