Build a serverless Dead Man's Switch for $0 so my friends stop worrying
Recently, a friend of mine panicked because I went offline for a few days without replying to messages. They actually thought I was in danger. I realized I needed a passive way to reassure people that āIām OKā without having to send active āIām hereā texts every single day. So, I built Iām OK, a serverless app to solve this problem, and to finally try out the Google Cloud stack. ...
Migrating My CLI APP BulkPR to a Github CLI Extension
Recently, I built a CLI tool called BulkPR for my job. Itās a simple app, but it works for what I needed. However, one challenge I faced was distribution. My colleagues use different systems-some on Windows, some on MacOS-and I need a way to ensure the tool worked smoothly across all environments. The Problem: Cross-Platform Distribution with Docker and Go At first, I tried to solve the cross-platform issue by using Goās built-in GOOS and GOARCH environment variables to build different binaries for each platform. This approach worked in theory, but I didnāt have access to the devices I needed to test on, so just made a workflow for that. ...
Reduced Next Js Docker Image
Recently, I noticed that the Docker image size for my Next.js project was quite large. So I decided to do some research and found ways to reduce the image size. Baseline Hereās what my initial Dockerfile looked like: FROM node:18 WORKDIR /app COPY . . RUN yarn install RUN yarn build EXPOSE 3000 CMD ["yarn", "start"] It ended up being around 3GB. Step 1: Use a Smaller Base Image Before making any changes, my Docker image was using the standard Node.js base image. To reduce the image size, I switched to the Alpine Linux version. Hereās the updated Dockerfile with a smaller base image: ...