gitlin/Dockerfile
Odyssey 40dcdcf68c switch to alpine for docker image
Signed-off-by: Odyssey <odyssey346@disroot.org>
2023-01-01 00:27:10 +01:00

21 行
430 B
Docker

FROM --platform=$BUILDPLATFORM golang:alpine AS build
ARG TARGETARCH
WORKDIR /src
RUN apk --no-cache add git
RUN git clone https://codeberg.org/gothub/gothub .
RUN go mod download
RUN GOOS=linux GOARCH=$TARGETARCH go build -o /src/gothub
FROM alpine:3.16 as bin
WORKDIR /app
COPY --from=build /src/gothub .
COPY --from=build /src/views ./views
COPY --from=build /src/public ./public
EXPOSE 3000
CMD ["/app/gothub", "serve"]