CSS only changes when restarting container

  • What’s your URL ? https//ghost-dev.kenjibailly.xyz

  • What version of Ghost are you using? >=4.0.0

  • How was Ghost installed and configured? Docker swarm (docker-stack.yml)

    image: ghost
    container_name: ghost-dev
    restart: unless-stopped
      - swag
      - /home/ubuntu/docker/ghost-dev/content:/var/lib/ghost/content
      # - /home/ubuntu/docker/ghost/themes:/var/lib/ghost/current/content/themes/
      - 8133:2368
      url: https://ghost-dev.kenjibailly.xyz
      NODE_ENV: development
      DEBUG: ghost:*,ghost-config node index.js
  • Site viewed from Chrome
  • What errors or information do you see in the console? No Errors
  • What steps could someone else take to reproduce the issue you’re having? Change the CSS file inside the container, ctrl F5 the page, css doesn’t change. Restart container, css changes.

I tried to start the ghost instance myself. But when I do ghost ls, I get “No installed ghost instances found”. While the web page works fine.

Themes are cached so they need to be installed via the admin area or via the API for changes to be picked up when running in production.

For theme development it’s recommended to run Ghost locally - How to install Ghost locally on Mac, PC or Linux - then install the theme in your production instance once it’s ready.

If you use git to keep track of your theme changes then you can use GitHub actions to automatically deploy your theme changes when you push them to GitHub

My docker-compose is running in development when looking at the docs, not in production if I’m not mistaken.

NODE_ENV: development

No idea why but ghost cli in windows is very slow. On my linux machine it goes way faster, which is why I have 2 ghost docker containers running. One for production, the other for development.
Is this not possible? Or do I need to build the entire dockerfile myself as I was building it locally?

I have it run locally in Windows right now and it works on changes, I just want to move my environment to a safe container.

Let me know if that’s possible, thanks for answering btw :slight_smile:

Hey there, I’ve also been having trouble getting theme changes to take effect.

I’m running ghost locally on a PC, activated the editorial theme and made some changes to the $pallette area in _vars.scss. I thought that live changes would take place on localhost, but not even restarting the server seemed to result in the color changes being reflected.

I downloaded the theme from ghost settings and the changes I’d made to palette had been seen and saved, but the site itself was still displaying as the default editorial theme.

I’ve gone into main.css and manually changed the background color in body (line 168) which has then taken effect once I’ve restarted ghost. Given what it says about live reloading here How to install Ghost locally on Mac, PC or Linux I’d assumed that any changes to theme files would be visible without needing to restart the ghost server. I would also have thought that changes to sass files would have auto-compiled to the css, is that not the case here?

Thanks for any help!

Compilation is custom to each theme so theme authors can choose whichever preprocessor/bundler they like or makes the most sense for the theme. If you check the theme’s read me file it should have instructions for how to build and usually how to start a file watcher for rebuilding on changes.

I’d spent so much time in the assets folder I’d completely forgotten about one level up. Thanks for the direction.