Skip to content

Instantly share code, notes, and snippets.

@carloscheddar
Created November 11, 2014 16:07
Show Gist options
  • Save carloscheddar/bd645e5329851e2ad8e4 to your computer and use it in GitHub Desktop.
Save carloscheddar/bd645e5329851e2ad8e4 to your computer and use it in GitHub Desktop.
Setting up a Ghost blog using Docker and Nginx
#For a more detailed approach go to this blog post
#http://carloscheddar.com/setting-up-a-ghost-blog-using-docker-and-nginx-part-1/
# Install Docker
curl -s https://get.docker.io/ubuntu/ | sudo sh
#Create folder to keep ghost data
mkdir ~/ghost-data
#Create Nginx data folder
mkdir -p ~/nginx/{logs,certs,sites-enabled}
#Create Docker storage container for ghost
#Send the absolute path of ghost-data
docker run -v /absolute/path/ghost-data/:/ghost-override --name=ghost-storage ubuntu
#Create storage container for Nginx
#Also needs the absolute path
docker run -v /absolute/path/nginx/logs:/var/log/nginx -v /absolute/path/nginx/certs:/etc/nginx/certs -v /absolute/path/nginx/sites-enabled:/etc/nginx/sites-enabled --name=nginx-storage ubuntu
#Add this file to the sites-enabled folder
#https://gist.github.com/carloscheddar/d8fd09bec8e4820dc7df
#Edit the server_name and access_log name
#Create the Ghost container
docker run -d --volumes-from ghost-storage --name=ghost dockerfile/ghost
#Create the Nginx container that links to the ghost container and forward ports
docker run -d -p 80:80 -p 443:443 --link ghost:ghost --volumes-from=nginx-storage --name=nginx dockerfile/nginx
#Test that the containers are running
docker ps
#If both nginx and ghost appear then you're ready to start blogging!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment