summaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 0edaa5ec975e7810ebf59f98806d63ee00316561 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Build backend
FROM golang:1.23.2-alpine3.20 AS backend
ARG VERSION
WORKDIR /srv
RUN apk update --no-cache && apk add --no-cache tzdata
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
RUN go build -o app .

# Runtime container
FROM alpine:3.20
WORKDIR /srv
RUN apk update --no-cache && apk add --no-cache ca-certificates

COPY --from=backend /usr/share/zoneinfo/Europe/Moscow /usr/share/zoneinfo/Europe/Moscow
COPY --from=backend /srv/app /srv/app

ENV TZ=Europe/Moscow

EXPOSE 8000

ENTRYPOINT ["/srv/app"]