Skip to content

Learning Docker Compose by Self-hosting Monica

I ran into Monica a while back, which bills itself as an "open source CRM"—an advanced address book. I’ve made it a hobby to meet random people I run into online. I really enjoy meeting new & interesting people, and I thought it would be nice to note down who I’ve met. This post is a compilation of notes from 1-2 years ago, and at the time, I did not have much experience with Docker (I really just used Heroku for all hosting and deployment before then). Self-hosting Monica on my raspberry pi was a great excuse to go deep and learn a lot about docker compose. Here’s some of what I learned getting Monica to run self-hosted on my raspberry pi…

Continue Reading

Choosing the right Ubuntu AMI for EC2

As part of setting up an app on an EC2 instance on AWS I wanted to try out Amazon Linux. Picking the latest compatible Amazon Linux AMI using CDK is easy: However, Amazon Linux isn’t always the right choice. What is Amazon Linux? It’s not Ubuntu, it’s Fedora (also, Amazon Linux 2 is older than 2023): Why? I have no idea. I’ve done a lot of random stuff in my time as a developer, and running into Fedora is not one of them. When I ran my ansible scripts against the gravitron fedora box it immediately failed: I was attempting to use ansible-dokku with Amazon Linux 2023, which explicitly is not supported. Gravitron-supported OS are listed here and included Ubuntu, so it was time to use an Unbuntu image…

Continue Reading

Using Ansible to Setup Custom Dotfiles

A while back I posted about using Ansible for an Elixir application. I recently wanted to update this application and add a couple of new features: Add my dotfiles to the server in a similar way to GitHub codespaces (using this role) Add brew, mostly for my dotfiles to work Automate more of the dokku-based setup Here’s the heavily commented ansible config for a dokku-based application (not specific to Elixir): Ansible learnings Some additional learnings this time around: lookup('env','HOME') is the directory of the environment that ansible is executed from, i.e. your computer directory. Same goes with lookup('file', '~/something')…

Continue Reading

Passing Environments Variables to EC2 Instances using AWS CDK

I was updating an older project that ran using dokku and hosted an Elixir/Phoenix application with a postgres database. Uptime and other normally important things didn’t matter, so I just wanted to host the database and application on a small EC2 instance. However, the application got complex enough (SQS queues, some lambdas, etc) that I wanted to pass the SQS endpoints automatically to the EC2 instances via environments. Should be easy, right? This feels like a very common use case. I struggled to find a solution to this problem that Just Worked…

Continue Reading

Deploying Nodejs on AWS Lambda using NodejsFunction

I wanted to deploy a node lambda on AWS using CDK. The NodejsFunction seemed like an improvement over using the standard Function construct: the CDK SDK would bundle your code for you, in a docker container running the same version of node used in the lambda. Instead of defining a code param you define an entry file that is used for the compilation process. This seems like a great improvement over copy/pasting your local nodejs application (including the local node_modules!) into the lambda…

Continue Reading