Currently, this site is published from a dedicated Obisidian vault and served with Perlite.
Obsidian is running with the obsidian-git plugin for automatic versioning.
Perlite Setup
Perlite has an easy Docker setup that will let you get up and running straight out of the box, however, the web container it uses is Nginx. These days I like to use Caddy as it completely automates Let’s Encrypt certs (it’s super sweet) and the Caddyfile config is usually much simpler.
The only changes you normally need to make to the docker-compose.yml is to change the NOTES_PATH and volumes to point properly to the Obsidian Vault folder you want to use on your server, however if you’re also looking to setup Caddy, here’s the cheatsheet:
Changes to the docker-compose.yml - remove the web and swap in:
caddy:
image: caddy:2
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- ./caddy-config:/config
- ./caddy-data:/data
volumes_from:
- perlite
depends_on:
- perlite
In the Perlite folder, make a caddy-config and caddy-data folder and a Caddyfile
And here’s what the Caddyfile looks like:
mostlyobvious.org {
log {
level INFO
output file /data/access.log {
roll_size 10MB
roll_keep 10
}
encode gzip
@block_override {
path */.obsidian/appearance.json
path */.obsidian/*/theme.css
}
handle @block_override {
file_server
}
@blocked {
path */.git* */.obsidian/* */.trash*
path *.json *.md
}
respond @blocked 403
root * /var/www/perlite
php_fastcgi perlite:9000
file_server
}
# Redirects
mostlyobvious.com, mostlyobvious.net {
redir https://mostlyobvious.org{uri}
}
Running this is quite lightweight, and docker stats says we’re actually using <20MiB of memory:
NAME CPU % MEM USAGE / LIMIT
perlite-caddy-1 0.01% 10.94MiB / 966.2MiB
perlite 0.01% 7.727MiB / 966.2MiB
Updating
Generally our main chnage is that we now completely remove the web service (we run our Caddy separately these days):
cd /srv/mostlyobvious/Perlite
cp docker-compose.yml docker-compose.local.yml
git checkout docker-compose.yml
git pull
# compare docker-compose.yml to docker-compose.local.yml
docker compose pull
docker compose up -d