Tangible Bytes

A Web Developer’s Blog

Windows 11 WSL2 and Docker Desktop

I’m a long time Linux user, and a big fan of Docker, Kubernetes, VMs, and containers.

While I love developing on Linux - I do sometimes find it frustrating that I don’t have the same level of access to the Microsoft suite on Linux.

A while ago I had to use a Windows laptop for a few days and tried out using WSL - so most of the time I’m in Linux - I didn’t entirely hate it so when it was time for an upgrade I decided to try the Windows route this time.

I’ve had my new machine for a little over a week now.

Read more ...

Docker, Firewalls, and Minikube

I’ve had a few problems with docker and firewalls and seem to get a “good enough” solution only to run into trouble again later having forgotten what I’ve done so far.

This is an attempt to make some notes and at least capture where I am up to.

TLDR

  • Disable dockers Iptables
  • Add some firewalld rules
  • Watch out if the Docker interface changes

https://dev.to/soerenmetje/how-to-secure-a-docker-host-using-firewalld-2joo

Read more ...

Postgresql Public Schema Docker Init

I am working on a postgresql database for a strapi CMS

I’ve taken over the project and when I try and start it I see this error.

create table "public"."strapi_migrations" 
    ("id" serial primary key,
     "name" varchar(255),
      "time" timestamp) 

- permission denied for schema public
Read more ...

Next.js Environment Variables

I’m running Next.js apps in production using Kubernetes - and I’ve inherited some setup that I didn’t fully understand so I’ve been investigating what is going on with environment variables.

My inherited system used a build per environment and bakes in configuration at that point.

I dislike this because …

Read more ...

PHP Docker for Dev

I’m staring a new PHP project and I wanted a clean docker image to work from.

I inherited one on my last project and wanted to improve image size, security and production alignment.

Read more ...

Wildcard Proxy

I have a client who need to spin up webservers on demand to quickly test code and content, they use Docker to host these sites.

Currently they expose each site an a different port - which needs to be configured both within the container so that it can perform appropriate redirects, and by the user needing to get to the right site.

I’m automating the spin up process and wanted to make this a bit smoother.

I like to use wildcard DNS for ephemeral servers such as these.

A wildcard DNS record is a record in a DNS zone that will match requests for non-existent domain names.

A wildcard DNS record is specified by using a * as the leftmost label (part) of a domain name, e.g. *.example.com.

wikipedia

I just point this address at my Docker server and then any name like website1.testsites.example.com will resolve to my docker host.

Read more ...