Skip to content

Instantly share code, notes, and snippets.

@alistaircol
Created July 7, 2021 19:39
Show Gist options
  • Save alistaircol/2ddc056120e4a31174b1025eb4c51cb6 to your computer and use it in GitHub Desktop.
Save alistaircol/2ddc056120e4a31174b1025eb4c51cb6 to your computer and use it in GitHub Desktop.
Image with default tailwindcss tailwind config viewer multi-stage build exporting static output to be hosted by a caddy server
# build
# docker build --force-rm --tag=alistaircol/tcv .
# run
# docker run --rm -it -p 9999:80 alistaircol/tcv:latest
FROM node:16-alpine AS build
WORKDIR /usr/src/app
RUN npm install tailwindcss tailwind-config-viewer; \
npx tailwindcss init --jit --full; \
npx tailwind-config-viewer export tcv-out
FROM caddy:2-alpine
WORKDIR /usr/share/caddy/
COPY --from=build /usr/src/app/tcv-out /usr/share/caddy/
EXPOSE 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment