Public | Automated Build

Last pushed: 4 hours ago
Short Description
Environment for building my website.
Full Description

nathangraham.info

This repository builds my static website (www.nathangraham.info). The content is mostly written in Markdown and rendered using Nikola.

I use Docker for the build environment. The Docker container runs an SSH server so I can log in and run the build scripts.
There are various references on the web that argue if you run SSHD in your Docker containers, you're doing it wrong.
However, in this particular case it is convenient gets the job done.

Build/run the docker container

host $ bash ./build_docker.sh

...or

host $ docker pull njgraham/nathangraham.info

Then,

host $ bash ./run_docker.sh

Edit site content

Use a text editor of your choice to edit files on the host (such as the main page, resume, etc.). Note that the resume is automatically converted to .docx and .pdf and links to download are added to the online resume page.

Update the Nikola configuration for things like Google Analytics, comment system, desired theme, etc.

Log in to the container via SSH and render the site (username: root, password: root)

host $ ssh root@localhost -p 2200
root@njginfo:~# cd /nathangraham.info/
root@njginfo:/nathangraham.info# bash ./build.sh

Preview the site

root@njginfo:/nathangraham.info# nikola serve

Then, visit http://localhost:8000.

Update s3cmd credentials and sync the site to Amazon S3

root@njginfo:/nathangraham.info# s3cmd --configure # one-time configuration per container run
root@njginfo:/nathangraham.info# bash ./sync.sh

See also Hosting a Static Website on Amazon S3.

Permissions

The rendered site is written to subdirectories of the repository directory on the host. On Linux hosts at least, these files are owned by root which can be inconvenient.

Docker Pull Command
Owner
njgraham
Source Repository

Comments (0)