I've always wanted to have my own blog, and not only until recently, I finally had a fair share of 💸 🔋 📚 enough to work on this.
Finding the best technology isn't always easy. When it comes to choosing the tech to use, I believe there’s no such thing as “silver bullet”. There's pros and cons for each available technology. AND THERE'S A LOT OF DIFFERENT TECHNOLOGIES TO CHOOSE FROM
I'll share here the technology I used in deploying this blog site. Tell you why I chose them and how I use them.
🔴 DISCLAIMER: Self-managed hosting are for those who are willing to learn through experience. If you think you're better off using managed hosting, that's actually better especially if you have the resource to do so.
TLDR: Here's my stackshare.io
A customizable, opensource publishing site: GhostCMS
3 reasons. (1) It's open-source. (2) I'm familiar with the underlying technology (node.js, handlebars.js, gulp). (3) I got it running instantly with docker-hub's sample docker-compose.yml!
If you already have docker installed, you can try by running the following commands:
mkdir ~/ghost-temporarycd ~/ghost-temporarycat << EOFF > compose.yml<< paste contents of the docker hub's compose yaml >>EOFFdocker compose up -dAfter running this, you should be able to access http://localhost:8080.
WAIT! Isn't WordPress open-source and much more popular?
True. But I feel WordPress is focused for e-commerce. It's much more powerful, but in return it's more complicated.
Infrastructure: Nginx reverse proxy and docker
Again, 3 reasons. (1) I'm familiar with it. (2) It feels lightweight. (3) And it's relatively easy to setup a reverse proxy.
After running docker containers above, the following file should create an nginx reverse proxy:
server { listen 80; server_name blog.chardskarth.me; return 301 https://$host$request_uri;}
server { listen 443 ssl; server_name blog.chardskarth.me;
ssl_certificate <path to my server.crt>; ssl_certificate_key <path to my server.key>;
location / { auth_basic off;
proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_http_version 1.1; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k;
# From: https://ghost.org/forum/bugs-suggestions/469-blog-cover-won-t-upload/11/ client_max_body_size 10m; client_body_buffer_size 128k;
proxy_pass http://localhost:<someport>/; proxy_redirect default; }}Web hosting & VPS: Digital Ocean Droplet
I chose Digital Ocean Droplet over AWS because of it's simplicity, it's slightly cheaper and it offers more out of the box for the cost.
I plan on learning more anyways so I don't mind the "small" headaches I'll encounter along the way of maintaining this blog site 🤡.
🚧 Right now, this blog site keeps getting unresponsive from time to time and I have to do restart every now and them. Keep posted. I hope I'll fix and write about it someday soon. 🟢 UPDATE! I was simply running out of memory. Good thing digital ocean has an easy-to-follow tutorial. Read my story here.
Development and Deployment
I mainly use neovim ( IdeaVim when I'm using IntelliJ ) so I can say I'm versed with command line and bash scripts.
I installed direnv and hooked up bash functions so I can quickly build custom ghost themes,
check if services are running, tweak nginx config, deploy and restart. See my story here.
Application Stack
The rest of the tech stack I mentioned are included tech stack of ghostcms: nodejs, gulp, handlebars.
Conclusion
I learned a lot of small things. The happiest learning so far is configuring this ghost cms to run on a dockerized container, behind an nginx reverse proxy.
It's seeming like a blissful journey (coupled with headaches) in maintaining this site and writing and sharing about things I learn in my journey as a software engineer and an engineering manager.