Indiekit server I use to publish content to the giacomodebidda-content repository.
To run this project locally you will need a MongoDB database and the Indiekit app itself. The file devenv.nix declares all the necessary components for a complete developer environment. This file is used by devenv to create and manage such environment.
devenv.nix defines a mongodb service (under the hood this background process is managed by Process Compose). You can start it by running this command in a terminal:
devenv upTo run the Indiekit Node.js app itself you have these alternatives:
- run the
servescript defined indevenv.nixto launch Indiekit as a Node.js application. - run the
container-runscript defined indevenv.nixto launch Indiekit as a containerized application (you will need to build the container image first by runningcontainer-build). - Click Run and Debug in VS Code to use the launch configuration provided in
.vscode/launch.json.
Tip
When debugging is useful to set the DEBUG environment variable.
My Indiekit server is deployed on Fly.io. My MongoDB database is hosted on MongoDB Atlas.
Every time I need to deploy a new version of my Indiekit server I run this command:
fly-deployNote
The Dockerfile is used to build the container image locally and it's also used by Fly.io. However, Fly.io uses a Dockerfile not to build a container image, but to create a Firecracker microVM.
Whenever I change a secret (e.g. MONGO_URL), I redeploy my secrets to Fly.io using this command.
fly-secrets-setWarning
As far as I understand, existing deployments in Fly.io are not updated to use the new secrets, so as soon as I edit my secrets I immediately redeploy my Indiekit server with fly-deploy.
To explore all layers of the container image, you can run this command that launches dive:
container-diveTo scan the container image for vulnerabilities, you can run this command that uses trivy:
container-diveTo inspect the developer environment generated by devenv, you can run devenv info.
Caution
The command devenv info will print all the secrets that you defined in your devenv.nix.