Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working in docker #13709

Closed
tsukinoko-kun opened this issue May 19, 2024 · 3 comments
Closed

not working in docker #13709

tsukinoko-kun opened this issue May 19, 2024 · 3 comments

Comments

@tsukinoko-kun
Copy link

What version of Tailwind CSS are you using?

3.4.3

What build tool (or framework if it abstracts the build tool) are you using?

Docker Compose

What version of Node.js are you using?

For example: 20.13.1

What browser are you using?

N/A

What operating system are you using?

macOS

Describe your issue

When running tailwindcss cli in a docker container, it isn't doing anything. Exits with code 0.

FROM node:current-bullseye
WORKDIR /App/BlazorApp
RUN ["npm", "install", "-g", "pnpm"]
ENTRYPOINT ["bash", "-c", "pnpm install && pnpm exec tailwindcss -i ./Styles/app.css -o ./wwwroot/app.css --watch"]

Isn't working with or without --watch.
Isn't working with or without tty: true in compose.yaml (#5324).

If I run the same thing outside of Docker it works as expected.

@tsukinoko-kun
Copy link
Author

I ensured that the tailwind config, package.json, input files (css, html, razor) are available and the container has write access.

@maxdzin
Copy link

maxdzin commented May 22, 2024

@tsukinoko-kun maybe stdin_open: true along with tty: true will help for your case?

@thecrypticace
Copy link
Contributor

thecrypticace commented May 31, 2024

You'll want to specify both stdin_open: true and tty: true in a docker compose file or you can run with the flags -t and -i. Our CLI exits when stdin is closed — this is a standard behavior for CLI tools. Alternatively, you can specify --watch=always which will not exit when stdin closes.

Here's an example compose file that works:

services:
  web:
    build: .
    tty: true
    stdin_open: true
    volumes:
      - type: bind
        source: ./app
        target: /App/BlazorApp

Or an example docker run command (assumes code is located at ./app in the current dir):

docker run -dti -v $(pwd)/app:/App/BlazorApp $(docker build -q .)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants