rimgo/Dockerfile

22 lines
586 B
Docker
Raw Normal View History

2022-06-03 22:45:14 +00:00
FROM --platform=$BUILDPLATFORM golang:alpine AS build
ARG TARGETARCH
2021-10-06 15:24:55 +00:00
2022-01-17 22:33:51 +00:00
WORKDIR /src
2023-06-10 16:23:29 +00:00
RUN apk --no-cache add ca-certificates git nodejs npm
2022-06-03 22:45:14 +00:00
COPY . .
2021-10-06 15:24:55 +00:00
2023-06-10 16:23:29 +00:00
RUN npx tailwindcss -i static/tailwind.css -o static/app.css -m
2022-02-21 17:26:31 +00:00
RUN go mod download
RUN GOOS=linux GOARCH=$TARGETARCH CGO_ENABLED=0 go build -ldflags "-X codeberg.org/video-prize-ranch/rimgo/pages.VersionInfo=$(date '+%Y-%m-%d')-$(git rev-list --abbrev-commit -1 HEAD)"
2021-10-06 15:24:55 +00:00
2022-03-19 19:58:12 +00:00
FROM scratch as bin
2021-10-06 15:24:55 +00:00
WORKDIR /app
2022-03-19 19:58:12 +00:00
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /src/rimgo .
2021-10-06 15:24:55 +00:00
2022-01-17 22:33:51 +00:00
EXPOSE 3000
2021-10-06 15:24:55 +00:00
CMD ["/app/rimgo"]