Skip to content
This repository has been archived by the owner. It is now read-only.
(🚫 not maintened) Expose Wintersmith static site generator preview server into a docker
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
settings
www
.gitignore
Dockerfile
README.md
Vagrantfile

README.md

wintersmith_docker

Expose Wintersmith static site generator (http://wintersmith.io) preview (which use a nodejs server) into a docker.

Currently, this is just a short try of playing with docker.

Method 1 : Vagrant

Pre-requis

Vagrant and Virtualbox installed in your local device.

Let the magic happend

Into the root directory of the project, run

vagrant up

That will use the setup.sh file include into settings directory and

  • built an Ubuntu VM (using the Vagrantfile)
  • installed Docker.io using the Dockerfile
  • run Nodejs server with Wintersmith new default site

Try it

Once everything run, you should be able to acces your website via http://localhost:8123

Method 2 : Docker

Pre-requis

Docker.io installed in your local device.

Build an Image with Nodejs and Wintersmith included.

docker build -t jygastaud/wintersmith .

You can now use wintersmith CLI on container run.

Examples

Case 1

You already have files generated by wintersmith

Just run the following command in your terminal:

sudo docker run -v ${PWD}/www/<website root folder>:/www/<website root folder> -w /www/<website root folder> --name wintersmtih_preview -p 8123:8080 -d jygastaud/wintersmith preview

Case 2

You want to generate a site with wintersmith

Build a data container
docker run --rm --name wintersmtih_build -w /www -d jygastaud/wintersmith new <website root folder>
Use Volume from data container as
docker run --volumes-from=wintersmtih_build -w /www/<website root folder> --name wintersmtih_preview -p 8123:8080 -d jygastaud/wintersmith preview
Copy files from container

Currently, there is no simple and quick solution to copy the folder generated into the data container. It should not work until that issue is open.

Current workaround

We recommand the install and use nsenter to create a tar file outside de mount volume and be able to get it via the "docker cp" command.

nsenter --target $PID --mount --uts --ipc --net --pid -- /bin/bash -c "tar -cvzf /<archive name>.tar /www/<website root folder>"

then, copy the file generated.

docker cp wintersmtih_build:/www/<website root folder> <local path>
Futurs solutions
docker run --volumes-from=wintersmtih_build -v ${PWD}/www/site:/www/website -w /www/website --name wintersmtih_preview -p 8123:8080 -d jygastaud/wintersmith preview

OR

docker cp wintersmtih_build:/www/<website root folder> <local path>

Try it

Once everything run, you should be able to acces your website via http://localhost:8123

You can’t perform that action at this time.