shorgru/Dockerfile

23 lines
546 B
Text
Raw Permalink Normal View History

2024-10-06 17:04:37 +03:00
# Build backend
FROM golang:1.23.2-alpine3.20 AS backend
ARG VERSION
WORKDIR /app
RUN apk update --no-cache && apk add --no-cache tzdata
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
2024-10-07 01:06:55 +03:00
RUN go build -o shorg ./cmd/shorg
2024-10-06 17:04:37 +03:00
# Runtime container
FROM alpine:3.20
WORKDIR /app
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 /app/shorg /app/shorg
ENV TZ=Europe/Moscow
EXPOSE 8000
2024-10-07 01:06:55 +03:00
ENTRYPOINT ["/app/shorg"]