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