With Docker Compose
The smallest setup is the app and PostgreSQL on one machine. The
repository’s deploy/compose.tiny.yml runs both with Docker or Podman
Compose:
git clone https://github.com/moe-studios/moekura
cd moekura
echo "POSTGRES_PASSWORD=$(openssl rand -hex 16)" > deploy/.env
MOEKURA_BUILD_VERSION="git-$(git rev-parse --short=7 HEAD)" \
docker compose -f deploy/compose.tiny.yml up -d
curl localhost:8080/readyz # → ok
Open http://localhost:8080. The database is migrated automatically on start.
The app’s port is published on 127.0.0.1 only, so only this machine
reaches it: other people come in through a reverse proxy,
which adds HTTPS and limits on what each client may do. Docker’s
published ports get past host firewalls such as ufw, so changing it to
"8080:8080" (to try the site from another machine on your network,
say) puts the app on every network the machine is on, without the
proxy’s protection; the app’s own connection limits
still apply.
Two volumes hold everything worth keeping: db (PostgreSQL) and files
(uploads and thumbnails). Back them up together; see Backups.
The PostgreSQL settings in the file suit a machine with 1 GB of memory; Hardware has what the stack needs and how to grow it.
The image (about 180 MB) includes its own builds of libvips and ffmpeg with only the formats Moekura accepts.
To suggest tags for uploads with the tagger, add its compose file:
MOEKURA_BUILD_VERSION="git-$(git rev-parse --short=7 HEAD)" \
docker compose -f deploy/compose.tiny.yml -f deploy/compose.tagger.yml up -d
Published images
Images are published to ghcr.io/moe-studios/moekura for AMD64 and ARM64:
0.8.0(for example): a release;0.8tracks its patch releases, and from 1.0 on1tracks every 1.x release;latesttracks stable releases.edge: the latest published main branch commit.git-<hash>: a specific commit, using either its seven-character or full hash.
Append -tagger to any tag for the tagger image, such as edge-tagger.
The page footer shows the release version or git-<short hash> embedded in
that build. Main builds do not move latest.
The compose files build from source. Since the Docker context excludes .git,
the commands above pass the version as a build argument. When building a
release checkout, set MOEKURA_BUILD_VERSION to its semver (without v).
Settings
Configure the app with MOEKURA_* environment variables in the compose file,
for example:
environment:
MOEKURA_DATABASE__URL: postgres://moekura:${POSTGRES_PASSWORD}@db/moekura
MOEKURA_SERVER__PUBLIC_URL: https://booru.example.com
MOEKURA_MEDIA__MAX_UPLOAD_MB: "200"
Every setting is listed under Configuration. Put the site behind a reverse proxy for HTTPS, which also means pinning the network and publishing the port on the loopback only, then continue with First steps.
Updating
git pull
MOEKURA_BUILD_VERSION="git-$(git rev-parse --short=7 HEAD)" \
docker compose -f deploy/compose.tiny.yml up -d --build
Migrations run when the new version starts.