Building a Personal Site with Docker and Zola

github repo

This repository contains the source and deployment setup for Justin Napolitano's personal site and blog. It is built primarily with HTML and uses Docker and Docker Compose for containerized development and production deployment.

Features

  • Static site content managed under the site directory using Hugo or a similar static site generator.
  • Dockerized build and deployment with multi-architecture support.
  • Environment-specific configurations for development and production.
  • Scripts for managing posts and DNS setup.
  • Integration with a MySQL database and RSS feed support (implied from content).

Tech Stack

  • HTML (primary language for site content)
  • Docker & Docker Compose (containerization and orchestration)
  • Bash scripting (automation scripts for posts and DNS)
  • Zola (static site generator, inferred from Makefile build args)

Getting Started

Prerequisites

  • Docker and Docker Compose installed
  • Bash shell for running scripts

Clone the repository

git clone https://github.com/justin-napolitano/jnapolitano-site.git
cd jnapolitano-site

Build and run the site

By default, the site runs in production mode with the base URL set to https://jnapolitano.com.

To build and start the site:

make up-prod

To start in development mode (with local IP base URL):

make up-dev

To rebuild the image from scratch (no cache):

make rebuild-prod
# or
make rebuild-dev

To stop the containers:

make down

To view logs:

make logs

Additional scripts

  • add_post.sh: Script to add new posts.
  • update_posts.sh: Script to update existing posts.
  • setup_github_dns.sh: Script to configure DNS for GitHub pages.

Project Structure

.
β”œβ”€β”€ add_post.sh            # Script to add new posts
β”œβ”€β”€ Caddyfile              # Web server configuration
β”œβ”€β”€ docker-compose.yml     # Docker Compose configuration
β”œβ”€β”€ Dockerfile             # Docker image build instructions
β”œβ”€β”€ Makefile               # Build and deployment commands
β”œβ”€β”€ setup_github_dns.sh    # DNS setup script
β”œβ”€β”€ site/                  # Static site content
β”‚   └── content/           # Markdown content for posts and pages
β”œβ”€β”€ update_posts.sh        # Script to update posts
β”œβ”€β”€ zz_dockerfile          # Possibly experimental or backup Dockerfile
└── zz_Makefile            # Possibly experimental or backup Makefile

Future Work / Roadmap

  • Add a detailed site description and metadata.
  • Automate deployment to GitHub Pages or other hosting platforms.
  • Integrate continuous integration/continuous deployment (CI/CD) pipelines.
  • Enhance multi-language support and accessibility.
  • Improve documentation for post automation scripts.

Note: This README assumes the use of Zola as the static site generator based on build arguments in the Makefile. Adjust accordingly if another generator is used.

hjkl / arrows Β· / search Β· :family Β· :tag Β· :datefrom Β· :dateto Β· ~/entries/slug Β· Ctrl+N/Ctrl+P for suggestions Β· Ctrl+C/Ctrl+G to cancel
entries 201/201 Β· entry -/-
:readyentries 201/201 Β· entry -/-