-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Docker Builds without style #2608
-
Hi all. I am trying to build it locally with Docker using the exact commands in the tutorial. But my built version is missing the styles. I don't why it is happening. Also, all the links in this built version are directed to 0.0.0.0:port instead of localhost:port. Any insight will be helpful. Thanks!
Snipaste_2024年11月16日_13-46-53
Snipaste_2024年11月16日_13-47-45
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 3 comments 3 replies
-
I experience the same issue.
Beta Was this translation helpful? Give feedback.
All reactions
-
Exactly the same.
Beta Was this translation helpful? Give feedback.
All reactions
-
I haven't worked with the Docker container that much, but usually when this issue occurs it's due to an issue with the _config.yml file and where Jekyll is looking for the files. Something to check might be that the baseurl setting makes sense for working inside of the container.
Beta Was this translation helpful? Give feedback.
All reactions
-
I'm having the same problem. The baseurl is "" in the _config.yml. Any solutions to this?
Beta Was this translation helpful? Give feedback.
All reactions
-
I ran into the same issue and I’m happy to share that I managed to solve it by adding an extra config file specifically for Docker and slightly modifying my docker-compose.yml. 🙌
✅ Step 1: Add a new config file
Create a file called _config_docker.yml with this line:
url: ""
✅ Step 2: Update your docker-compose.yml
Make sure your docker-compose.yml looks like this:
services: jekyll-site: image: jekyll-site build: . volumes: [ .:/usr/src/app ] ports: [ 4000:4000 ] environment: [JEKYLL_ENV=docker] user: 1000:1000 command: jekyll serve --host 0.0.0.0 -w --config _config.yml,_config_docker.yml
The key part is adding the extra config file to the command section and setting the environment variable.
This idea came from a super helpful Stack Overflow post — huge thanks to the folks over there! 🙏
Hope this helps someone else! 😊
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Thanks a lot!
Beta Was this translation helpful? Give feedback.