You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
549 B

FROM --platform=$BUILDPLATFORM golang:1.21-alpine AS build
LABEL authors="kbruen"
LABEL org.opencontainers.image.source=https://github.com/dancojocaru2000/CfrTrainInfoTelegramBot
WORKDIR /app
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY main.go ./
COPY pkg ./pkg/
ARG TARGETOS TARGETARCH
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o server
FROM scratch
COPY --from=build /etc/ssl/certs /etc/ssl/certs
WORKDIR /app
# COPY static ./static/
COPY --from=build /app/server ./
ENV DEBUG=false
ENTRYPOINT [ "/app/server" ]