rimgo/Dockerfile
nyuuzyou 2cb5bcebf3 Fix Docker build failure with Tailwind CSS v4
This PR fixes the Docker build failure caused by incompatibility with the new CLI command structure of Tailwind CSS v4. Previously, the build failed with the error: `npm error could not determine executable to run.`

https://github.com/tailwindlabs/tailwindcss/discussions/15820
2025-03-27 21:04:13 +00:00

22 lines
579 B
Docker

FROM --platform=$BUILDPLATFORM golang:alpine AS build
ARG TARGETARCH
WORKDIR /src
RUN apk --no-cache add ca-certificates git nodejs npm
COPY . .
RUN npx @tailwindcss/cli -i static/tailwind.css -o static/app.css -m
RUN go mod download
RUN GOOS=linux GOARCH=$TARGETARCH CGO_ENABLED=0 go build -ldflags "-X codeberg.org/rimgo/rimgo/pages.VersionInfo=$(date '+%Y-%m-%d')-$(git rev-list --abbrev-commit -1 HEAD)"
FROM scratch as bin
WORKDIR /app
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /src/rimgo .
EXPOSE 3000
CMD ["/app/rimgo"]