https://github.com/scriptogre/tailwindcss-docker
A minimal Docker image for running the Tailwind CSS standalone CLI with proper signal forwarding.
https://github.com/scriptogre/tailwindcss-docker
docker tailwindcss tailwindcss-cli tini
Last synced: about 2 months ago
JSON representation
A minimal Docker image for running the Tailwind CSS standalone CLI with proper signal forwarding.
- Host: GitHub
- URL: https://github.com/scriptogre/tailwindcss-docker
- Owner: scriptogre
- Created: 2025-05-12T11:54:07.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-12T13:14:30.000Z (about 1 year ago)
- Last Synced: 2025-05-12T22:59:22.961Z (about 1 year ago)
- Topics: docker, tailwindcss, tailwindcss-cli, tini
- Language: Dockerfile
- Homepage: https://ghcr.io/scriptogre/tailwindcss
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TailwindCSS in Docker
A dead simple way to run [Tailwind CSS](https://tailwindcss.com/) from a Docker container.
No more **Node.JS**. No more **manual downloads of the CLI**.
1. Create `input.css` in your project:
```css
@import 'tailwindcss';
```
2. Create `docker-compose.yml` in your project:
```yaml
services:
tailwindcss:
# You can also use pinned versions, e.g. `:4.1.7`
image: ghcr.io/scriptogre/tailwindcss:latest
tty: true # Required for watch mode
volumes:
- .:/app
command: -i ./input.css -o ./output.css --watch
```
3. Or run `docker run` command (note the `-t` flag is required for watch mode):
```bash
docker run -t -v "$(pwd)":/app \
ghcr.io/scriptogre/tailwindcss:latest -i ./input.css -o ./output.css --watch
```
### **Watch Mode Requirement**
- For watch mode (`--watch`), you must:
- In `docker-compose.yml`: Set `tty: true`
- In `docker run`: Use the `-t` flag
- Without these, the container will exit after the first build
### **Notes:**
- Make sure you mount all source files (`*.html`, `*.css`, `*.js`, …) to `/app`, so Tailwind’s watcher can see them within the container.
- The `ghcr.io/scriptogre/tailwindcss:latest` image is rebuilt daily to track the newest Tailwind CSS release.