gitlin/Dockerfile
Odyssey 8f95e44fab Add Docker environment variable (closes #15)
Signed-off-by: Odyssey <odyssey346@disroot.org>
2023-01-05 20:41:47 +01:00

22 行
446 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
ENV DOCKER true
EXPOSE 3000
CMD ["/app/gothub", "serve"]