Hey everyone, I'm running a Node.js application in Docker, where the frontend and backend are served from the same container. Everything builds and runs fine, but I've noticed that even after updating the CSS files in the `web/css/` directory and rebuilding the image, my browser still shows the old styles. I've checked that the updated files are definitely present in the image by using `docker exec` to inspect the container. Plus, I'm not using any CDN. I've cleared my browser cache, tried incognito mode, and even used curl, but I'm still seeing the outdated styles. What could be causing Docker to serve these old CSS files despite rebuilding the container?
2 Answers
Check if you've mapped a folder to your container; if that’s the case, you might accidentally be overwriting your new files with old ones from your host system.
Since you've confirmed that the new files are in the image, the problem likely isn't with Docker itself. It could be that you’re not actually using the updated image due to a human error, or perhaps something odd is happening with your app.
Serving both frontend and backend from the same container isn’t bad as long as you follow the single process pattern! It can actually work well with setups like NGINX Unit.
Yes! That turned out to be the issue for me too, mapping was the culprit.