monotux.tech


Linkding on fly.io

fly.io, django, sqlite

Yet another container running on fly.io, this time a Django application.

Shortly after writing this up, I discovered the excellent repository fspoettel/linkding-on-fly which does a better job than below, including setting up litestream backups. :-)

This was very straight forward to setup. First, launch an application and create a volume:

# I'm using region ARN for below
$ flyctl launch --vm-size shared-cpu-1x -r arn --name linkding-example
$ flyctl volumes create linkding_example_data -s 1 -r arn -a linkding-example

Then, edit your fly.toml into something like this:

app = "linkding-example"
primary_region = "arn"

[build]
  image = "sissbruecker/linkding:latest"

[mounts]
  source = "linkding_example_data"
  destination = "/etc/linkding/data"

[http_service]
  # Container exposes 9090
  internal_port = 9090
  force_https = true
  auto_stop_machines = true
  auto_start_machines = true
  min_machines_running = 0
  processes = ["app"]

[[vm]]
  cpu_kind = "shared"
  cpus = 1
  memory_mb = 256

Then, finally create a superuser using the Django tooling:

$ /opt/venv/bin/python manage.py createsuperuser --username=joe --email=joe@example.com

I’ve created two users, one superuser, and one normal user. I use the latter as my ’end user'.