From a2506df79dfd56c1a73b5a0e26e5f0a5a55e0f97 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Fri, 17 Dec 2021 17:55:08 -0600 Subject: [PATCH] Add hosting on my own server post --- .../index.md | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 content/blog/2021-12-17-hosting-on-my-own-server/index.md diff --git a/content/blog/2021-12-17-hosting-on-my-own-server/index.md b/content/blog/2021-12-17-hosting-on-my-own-server/index.md new file mode 100644 index 00000000..0e21f55b --- /dev/null +++ b/content/blog/2021-12-17-hosting-on-my-own-server/index.md @@ -0,0 +1,35 @@ +--- +title: "New hosting" +date: 2021-12-17T17:26:07-06:00 +--- + +After years of hosting this blog on [Netlify](https://www.netlify.com/), I've +decided to finally move it to my [Dokku](https://dokku.com/) server hosted with +[Linode](https://www.linode.com/). Don't get me wrong Netlify is great, but +I realised I wanted a bit more control over my own hosting and Dokku gives me +that. I'd like to spin up a Gemini site at some point in the future and hosting +on my own server should make that much easier. + +After playing around with various buildpacks to build the site on Dokku I ended +up settling on a custom `Dockerfile` config that works great and means I can +deploy in less than two minutes. + + + +```dockerfile +# Dockerfile +FROM alpine:latest +RUN apk add --no-cache bash hugo +WORKDIR /app +COPY . ./ +``` + +```sh +# Procfile +release: hugo -v +web: hugo server --disableLiveReload --bind '0.0.0.0' -p ${PORT} +``` + +This was all that was required to get things up and running. The site generates +a lot of resized images on build so I needed to mount a volume to make sure that +was persistent between deploys.