~blowry/sourcehut-compose

a rather bad docker-compose setup for sourcehut
revise readme slightly
forgot to commit makefile, oops
Initial commit

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~blowry/sourcehut-compose
read/write
git@git.sr.ht:~blowry/sourcehut-compose

You can also use your local clone with git send-email.

sourcehut-compose

This is a simple docker/podman-compose setup with images for running various sourcehut services. It's honestly just easier to use an Alpine VM, but if you want containers feel free to use this. You can send me patches if you really want to.

Usage

I use podman, if you use docker just s/podman/docker/ when following these instructions.

  1. Clone all of the sourcehut services into named folders, and build all of the images with make. They can also be built automatically by podman-compose but I prefer this method.

  2. add to /etc/hosts:
    127.0.0.1 meta.sr.ht.local 
    127.0.0.1 git.sr.ht.local 
    127.0.0.1 todo.sr.ht.local 
    127.0.0.1 paste.sr.ht.local 
    127.0.0.1 todo.sr.ht.local
  3. If you're using podman or another unprivileged container runtime, run this command to allow nginx to bind to port 80: sudo sysctl net.ipv4.ip_unprivileged_port_start=80

  4. In the folder etcsrht (which is mounted as /etc/sr.ht in the containers), put a config.ini file edited for all of the services you want to run. Your PostgreSQL connection strings should look like postgresql://postgres@db/paste.sr.ht, and your Redis strings should look like redis://redis:6379/1.

  5. Setup the PostgreSQL database for each service. In short, using meta.sr.ht as an example:

    • podman exec -it sourcehut-compose_db_1 psql -U postgres
    • CREATE DATABASE "meta.sr.ht";
    • \q
    • podman exec -it sourcehut-compose_meta_1 sh
    • python3
    • from metasrht.app import db
    • db.create()
  6. At this point meta.sr.ht.local should be working. If not, check the logs using podman logs sourcehut-compose_whatever_1, and/or sob into your hands. Follow the instructions in the official man.sr.ht installation guide for creating an OAuth token for each service and setting it to preauthorized.

License

These configuration files are released into the public domain under the terms of Creative Commons Zero 1.0 Universal.