Faster Next.JS docker builds with npm cache

If you have a Dockerfile which looks something like (note: likely not complete, this is a very stripped down version of our Dockerfile): FROM node:16.19.0 as prodbuild COPY ./package*.json ./ RUN npm ci –omit=dev FROM node:16.19.0 as build COPY ./package*.json ./ # We need dev dependencies to actually do the build RUN npm ci RUN npm run web:build FROM node:16.19.0 COPY –from=prodbuild /usr/src/node_modules ./node_modules COPY –from=build /usr/src/.next .next ENTRYPOINT ["npm", "run", "start"] There are a few inefficiencies.
Read more →

Sentry reports browser runtime for errors in getServerSideProps in a Next development build

In Development mode for next.js (npm run dev), errors within getServerSideProps, which are supposed to occur solely in the node.js runtime, are inaccurately reported by Sentry as originating from the Browser. This means that any changes made to the server-side scope are not reflected in the trace. This anomaly might stem from a Next.js feature that catches and displays server-side errors and stack-traces in the browser to assist development. It seems Next.
Read more →

On Servers and Monitoring

One of the most important things to get right when setting up server infrastructure is monitoring. Proper server monitoring is your best friend and will easily pay back any time and money you invest in getting it right. On the face of it, server monitoring seems like a fairly simple problem. Just decide what needs to be monitored, find a tool to do it, and set up alerts when something goes wrong.
Read more →

Adventures in Low Level Programming - Text play

This is part two of my adventures in low level programming series. In part one we got our computer to boot and then just sit there spinning it’s wheels. It doesn’t feel like much of an achievement at the moment, but in this installment we’ll start to see something a little more exciting. Before we get stuck in, we’ll need a little more background though (boo! I know). Obviously at this stage we don’t want to be writing the text rendering code ourselves, nor do we want to be worrying about placement of the characters.
Read more →

Adventures in Low Level Programming

Ohh, this is going to be a fun one! And one I’ve played with in the past to varying degrees of success. What I’m trying to achieve here is simple, I want to boot a computer from nothing to running some C code which prints “Hello, World!” to the screen. The C code will be sitting on a FAT32 drive attached to the computer. Getting an environment setup First things first, we’re going to need to get a development environment up and running.
Read more →