question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

styles.css not updating when running in docker

See original GitHub issue

I have a tailwind service in my docker-compose.yml with the following command: command: "python manage.py tailwind start"

For some reason, it does not update the styles.css But if I exec into the same container and then manually run the same command, it does update the file

Here are the logs of the command running using docker-compose:

> theme@2.2.1 dev:sync

> run-p dev:tailwind sync



> theme@2.2.1 sync

> browser-sync start --config bs.config.js



> theme@2.2.1 dev:tailwind

> cross-env NODE_ENV=development tailwindcss --postcss -i ./src/styles.css -o ../static/css/dist/styles.css -w


[Browsersync] Watching files...

And here are the logs when I use exec to run the same command on the same container:

> theme@2.2.1 dev:sync
> run-p dev:tailwind sync


> theme@2.2.1 dev:tailwind
> cross-env NODE_ENV=development tailwindcss --postcss -i ./src/styles.css -o ../static/css/dist/styles.css -w


> theme@2.2.1 sync
> browser-sync start --config bs.config.js

[Browsersync] Watching files...

warn - You have enabled the JIT engine which is currently in preview.
warn - Preview features are not covered by semver, may introduce breaking changes, and can change at any time.

Rebuilding...
Done in 307ms.
[Browsersync] File event [change] : ../static/css/dist/styles.css

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
treycommented, Dec 31, 2021

Yes, there is.

Thank you, @roushikk! I’m still a Docker noob in many ways. Thanks for showing me a better way! 😃

1reaction
roushikkcommented, Dec 31, 2021

Is there a standard way of then not running that service in production?

Yes, there is. You usually have a base docker-compose.yml file and you extend it for different environments like dev, staging and production.

So, you’ll have a base docker-compose.yml file without the tailwind service and then you’ll have a docker-compose.dev.yml in which you’ll add the tailwind service.

Official Docker documentation: https://docs.docker.com/compose/extends/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker reload does not reflect changes in CSS files
I've configured docker to reload automatically when i make changes to my project files. It works fine when i make changes in HTML...
Read more >
Running with docker does not load css and js assets #46
Running using docker build -t snomedstorm-browser-nginx . docker run --name snowstorm-nginx -d -p 80:80 -v ...
Read more >
CSS Files not updating - Laracasts
I'm having trouble getting my CSS changes to appear in my app. Some solutions I've tried: Setting 'sendfile off' in nginx.config Setting server...
Read more >
Solving the React Error: Not Picking Up CSS Style | Pluralsight
In this guide, you will learn about the errors that can occur while importing a CSS file into your React file.
Read more >
10 Most Common Bootstrap Mistakes That Developers Make
You can overwrite in your own stylesheet default bootstrap colors, styles, margins, paddings, everything. There is no need to touch the bootstrap.css ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found