Run a website with the Middleman web server.
349
This docker image is used for building or running middleman projects.
In order for middleman-livereload to work, be sure to set the livereload host and js_host properties in the application config.rb file:
activate :livereload do |reload|
reload.host = '0.0.0.0'
reload.js_host = '0.0.0.0'
end
The commands listed below assume you are mapping your current working directory on your host machine to the /app directory on the running docker container.
The image is setup to serve the application from the /app directory on the running container. You can map this directory to the Middleman application directory on your host machine using the -v command line option.
To install all the dependencies and run the project:
First change to the project directory:
cd /usr/share/my-www-project
Then start the middleman server:
docker run \
-p 4567:4567 \
-p 35729:35729 \
-v "$(PWD)":/app \
kineticdata/middleman \
bash -c "bundle install && middleman server"
The website will be running at http://localhost:4567.
Any changes you make to your project files on the host machine should automatically reload on the container's middleman server. If you add or change any gems in your project, you will need to start a new docker container to install the gems.
To install all the dependencies and build the project:
First change to the project directory:
cd /usr/share/my-www-project
Then tell middleman to build the project:
docker run \
-v "$(PWD)":/app \
kineticdata/middleman \
bash -c "bundle install && middleman build"
docker pull kineticdata/middleman:latest