Unable to install Tailwind during Docker build

Hi, I’m not exactly sure what’s going on here, but I have two suggestions.

  1. Try using golang:1.23-bullseye as base image instead of alpine.

  2. Use a multi-stage build to install tailwind with a node package manager.

FROM node:20-slim AS tailwind-builder

WORKDIR /app

COPY ./package.json ./package-lock.json ./styles.css /app
RUN npm install
RUN npx @tailwindcss/cli -i ./styles.css -o ./styles-compiled.css

FROM golang:1.23-alpine AS builder

COPY --from=tailwind-builder /app/styles-compiled.css /app/styles.css

# ...