How do I serve a Harp/nginx page from Docker?

I’m trying to run nginx and Harp in a Docker container to serve my blog.

I’ve found this: https://github.com/octohost/harp-nginx

When I run sudo docker pull octohost/harp-nginx, it downloads a bunch of files, but this is where I am stuck.

sudo docker run -d -P octohost/harp-nginx doesn’t seem to do anything. After I run this, if I look at sudo docker -ps -a I can see that the container gets created, then exits 1-2 seconds later. I also don’t know how to see what ports my website will be served on.

I know that there are several ways for Docker to access files on the parent OS: https://blog.docker.com/2015/04/tips-for-deploying-nginx-official-image-with-docker/

I want the harp-nginx container to mount a directory, for instance ~/my_blog/, and have Harp compile these on the fly and serve them with nginx (on a custom port because 80 is already in use). I want to edit the markdown source in ~/my_blog/ from the parent OS, and have the changes automatically take effect in the website. However I can’t figure out what to do with the octohost container linked above. How can I accomplish what I want?


Source: ubuntu

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.