Skip to content

jackdbd/giacomodebidda-indiekit

Repository files navigation

My Indiekit server

Indiekit server I use to publish content to the giacomodebidda-content repository.

Development

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 up

To run the Indiekit Node.js app itself you have these alternatives:

  • run the serve script defined in devenv.nix to launch Indiekit as a Node.js application.
  • run the container-run script defined in devenv.nix to launch Indiekit as a containerized application (you will need to build the container image first by running container-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.

Production

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-deploy

Note

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-set

Warning

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.

Troubleshooting

To explore all layers of the container image, you can run this command that launches dive:

container-dive

To scan the container image for vulnerabilities, you can run this command that uses trivy:

container-dive

To 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.

Other people's Indiekit configurations

About

Indiekit server for my personal website

Topics

Resources

Stars

Watchers

Forks

Contributors