Skip to content

Commit

Permalink
Fix Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
markuswustenberg committed Feb 21, 2025
1 parent 106d1e8 commit 8b9c021
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
FROM --platform=${BUILDPLATFORM} debian:stable AS cssbuilder
FROM --platform=${BUILDPLATFORM} golang AS cssbuilder
WORKDIR /app

RUN set -x && apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y curl

# The URL uses x64 instead of amd64
ARG BUILDARCH
RUN ARCH=$( [ "${BUILDARCH}" = "amd64" ] && echo "x64" || echo "arm64" ) && \
curl -sfLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-${ARCH}
curl -sfLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-${ARCH}
RUN mv tailwindcss-linux-* tailwindcss
RUN chmod a+x tailwindcss

COPY tailwind.css ./
COPY tailwind.config.js ./

COPY go.mod go.sum ./
RUN go mod download

COPY html ./html/

RUN ./tailwindcss -i tailwind.css -o app.css --minify



FROM --platform=${BUILDPLATFORM} golang AS gobuilder
WORKDIR /app

Expand All @@ -29,6 +30,8 @@ COPY . ./
ARG TARGETARCH
RUN GOOS=linux GOARCH=${TARGETARCH} go build -buildvcs=false -ldflags="-s -w" -o ./app ./cmd/app



FROM debian:stable-slim AS runner
WORKDIR /app

Expand Down

0 comments on commit 8b9c021

Please sign in to comment.