minio single node single disk docker compose with letsencrypt tls

How to have a single node minio instance,
with docker compose,
and auto updating letencrypt certificate.

Prerequisite:
A way to obtain a cert for your domain via certbot.
The certs should already exist and be able to be renewed.

1st create the docker minio directories.

/docker/minio/compose.yaml

/etc/letsencrypt/renewal-hooks/deploy/copy-certs.sh

And finally start it

How to package your SPA or PWA without a Dockerfile using Go and ko

Writing Dockerfiles is a pain in the ass.
All you want to do is publish your SPA or PWA dist files in a docker container and maybe even push it to a private registry.

Instead of having to write a Dockerfile, pull some base OS, increase the size of the container image, add potential attack surfaces / vulnerabilities coming from those base OS images, you can wrap and embed it in a Go binary.

Install ko

Create a ko-build.sh in the project root

and edit main.go and insert the following

assuming your bundler, e.g. vite, places dist files in your project root’s dist dir (vite default),

If your dist files are in dist/pwa and your index file is at dist/pwa/index.html edit the lines accordingly.

This is effectively what would be in nginx:

Your container exposes port 8080

Build and publish

Since you only need to write this once, you can copy the main.go to every project that requires it and adjust the ko-build.sh script.

Yes, this survives CTRL+F5 reloads. It routes everything through index.html unless it’s a static file that exists on the filesystem.

k8s delete pv or pvc first?

Short answer: Delete the pvc, then the pv.
From k8s v1.31 on if the external-csi-provisioner is installed (which it is with rook ceph) and the reclaim policy is Delete, if you delete the pvc, the pv is automatically deleted