|
1 | | -# ─── Stage 1: Download Tailwind CLI ───────────────────────── |
| 1 | +# ─── Stage 1: Download TailwindCSS CLI ───────────────────────── |
2 | 2 | FROM curlimages/curl:latest AS downloader |
3 | 3 |
|
4 | | -ARG TAILWIND_VERSION=4.1.5 |
| 4 | +ARG TAILWINDCSS_VERSION |
5 | 5 | ARG TARGETPLATFORM |
6 | 6 | ARG TARGETVARIANT |
7 | 7 |
|
8 | | -# Download TailwindCSS standalone CLI |
| 8 | +# Download TailwindCSS CLI |
9 | 9 | RUN set -eux; \ |
10 | 10 | platform="$TARGETPLATFORM"; \ |
11 | 11 | OS="${platform%/*}"; \ |
12 | 12 | ARCH="${platform#*/}"; \ |
13 | 13 | [ "$ARCH" = "amd64" ] && ARCH=x64; \ |
14 | 14 | [ "$ARCH" = "aarch64" ] && ARCH=arm64; \ |
15 | | - url="https://github.com/tailwindlabs/tailwindcss/releases/download/v${TAILWIND_VERSION}/tailwindcss-${OS}-${ARCH}${TARGETVARIANT}"; \ |
| 15 | + url="https://github.com/tailwindlabs/tailwindcss/releases/download/v${TAILWINDCSS_VERSION}/tailwindcss-${OS}-${ARCH}${TARGETVARIANT}"; \ |
16 | 16 | curl -fSL -o /tmp/tailwindcss "$url"; \ |
17 | 17 | chmod +x /tmp/tailwindcss |
18 | 18 |
|
19 | 19 |
|
20 | 20 | # ─── Stage 2: Final Image ─────────────────────────────────────────────── |
21 | 21 | FROM debian:bullseye-slim |
22 | 22 |
|
23 | | -ARG TAILWIND_VERSION=4.1.5 |
| 23 | +ARG TAILWINDCSS_VERSION |
24 | 24 |
|
25 | 25 | # Image metadata |
26 | 26 | LABEL org.opencontainers.image.title="Tailwind CSS CLI Docker Image" |
27 | 27 | LABEL org.opencontainers.image.description="Minimal Docker image packaging the Tailwind CSS standalone CLI" |
28 | 28 | LABEL org.opencontainers.image.documentation="https://github.com/scriptogre/tailwindcss-docker#readme" |
29 | 29 | LABEL org.opencontainers.image.source="https://github.com/scriptogre/tailwindcss-docker" |
30 | 30 | LABEL org.opencontainers.image.url="https://github.com/scriptogre/tailwindcss" |
31 | | -LABEL org.opencontainers.image.version="${TAILWIND_VERSION}" |
| 31 | +LABEL org.opencontainers.image.version="${TAILWINDCSS_VERSION}" |
32 | 32 | LABEL org.opencontainers.image.authors="scriptogre" |
33 | 33 |
|
34 | | -# Copy Tailwind CLI from `downloader` stage |
| 34 | +# Install Watchman |
| 35 | +RUN apt-get update && \ |
| 36 | + apt-get install -y --no-install-recommends watchman && \ |
| 37 | + rm -rf /var/lib/apt/lists/* |
| 38 | + |
| 39 | +# Copy Tailwind CLI from `downloader` |
35 | 40 | COPY --from=downloader /tmp/tailwindcss /usr/local/bin/tailwindcss |
36 | 41 |
|
37 | | -# Set /code as work dir (this is where user's files should be mounted) |
38 | | -WORKDIR /code |
| 42 | +WORKDIR /app |
39 | 43 |
|
40 | 44 | ENTRYPOINT ["/usr/local/bin/tailwindcss"] |
41 | 45 |
|
| 46 | +# Ensures container doesn't hang on CTRL+C (alternative is setting `stop_grace_period: 0` in `docker-compose.yml`) |
| 47 | +STOPSIGNAL SIGKILL |
| 48 | + |
42 | 49 | # Default to TailwindCSS CLI's help message |
43 | 50 | CMD ["--help"] |
0 commit comments