DioxusLabs / DioxusLabs/dioxus

Tailwind CSS is not built in an Alpine Docker container

Open
#5,150 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

Although in a Debian Bookworm container, everything works as expected, in an Alpine container built with an equivalent Dockerfile, Tailwind CSS is not being built.

**Steps To Reproduce**

Steps to reproduce the behavior:

1. Clone the [reproduction repo](https://github.com/matous-volf/dioxus-tailwind-docker-bug) (the bare-bones `dx new` template, just added a single paragraph colored by Tailwind).
2. Run
```
docker compose -f docker-compose-debian.yaml up --build -d
```
3. Exec into the container with
```
docker compose -f docker-compose-debian.yaml exec -it app sh
```
4. In there, run
```
dx serve --addr 0.0.0.0 --port 8000
```
6. Wait for the build to finish.
7. Observe the successful result at http://localhost:8000:
Image**Expected behavior**
8. Run
```
docker compose -f docker-compose-debian.yaml down
```
9. Repeat the steps from 2. but with `docker-compose-alpine.yaml`.
10. Observe the error:
```
[cargo] error: Asset at /assets/tailwind.css doesn't exist
--> src/main.rs:6:29
|
6 | const TAILWIND_CSS: Asset = asset!("/assets/tailwind.css");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
Even if you
```
touch assets/tailwind.css
```
it isn't generated afterwards.

**Expected behaivor**

The build on Alpine should work without errors, as it does on Debian.

**Environment:**

- Dioxus version: 0.7.2
- Rust version: 1.92.0
- OS info: Debian Bookworm vs. Alpine 3.23
- App platform: web

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.