Skip to content

Advanced Deployment

Run AdventureLog as three containers: SvelteKit frontend, Django backend, and PostGIS database. This layout gives full control over environment variables and is the best fit for reverse proxies and custom integrations.

Looking for the simplest setup? See Standard Deployment — one container, one port, two required env vars.

Full env reference: Environment Variables

Prerequisites

  • Docker installed on your machine/server. You can learn how to download it here.
  • Memory: allocate at least 2 GB RAM for the first boot (world geography data import). Steady-state use typically needs about 1 GB.

Getting Started

Get the docker-compose.advanced.yml and .env.advanced.example files from the AdventureLog repository. You can download them here:

bash
wget https://raw.githubusercontent.com/seanmorley15/AdventureLog/main/docker/docker-compose.advanced.yml
wget https://raw.githubusercontent.com/seanmorley15/AdventureLog/main/.env.advanced.example
cp .env.advanced.example .env.advanced

TIP

If running on an ARM based machine, you will need to use a different PostGIS image. It is recommended to use the imresamu/postgis:16-3.5-alpine image or a custom version found here. The AdventureLog containers are ARM compatible.

URL mental model

AdventureLog uses several URL-related environment variables. Most installs only need to set the public-facing URLs; keep PUBLIC_SERVER_URL at its default.

VariableWho uses itTypical value
PUBLIC_SERVER_URLSvelteKit SSR (container-to-container)http://server:8000do not change for Advanced Deployment installs
ORIGINSvelteKit origin when not using HTTPSYour frontend URL, e.g. http://localhost:8015
PUBLIC_URLDjango image and OAuth URLsYour backend URL, e.g. http://localhost:8016 (or your single domain if using a reverse proxy)
FRONTEND_URLDjango emails and redirectsYour frontend URL, e.g. http://localhost:8015
CSRF_TRUSTED_ORIGINSDjango CORS and CSRFComma-separated list of every browser origin, e.g. http://localhost:8015,http://localhost:8016

When frontend and backend share one domain behind a reverse proxy, you can set SITE_URL instead of configuring ORIGIN, FRONTEND_URL, PUBLIC_URL, and CSRF_TRUSTED_ORIGINS individually. See .env.advanced.example for details.

To validate your configuration, run:

bash
bash scripts/validate-env.sh

Configuration

The .env file contains all configuration for your instance. Below are the most important variables — see Environment Variables for the complete reference.

🌐 Frontend (web)

NameRequiredDescriptionDefault Value
PUBLIC_SERVER_URLYesUsed by the frontend SSR server to connect to the backend. Almost every user user will never have to change this from default!http://server:8000
ORIGINSometimesNeeded only if not using HTTPS. Set it to the domain or IP you'll use to access the frontend.http://localhost:8015
BODY_SIZE_LIMITYesMaximum upload size in bytes.Infinity
FRONTEND_PORTYesPort that the frontend will run on inside Docker.8015

🐘 PostgreSQL Database

NameRequiredDescriptionDefault Value
PGHOSTYesInternal DB hostname.db
POSTGRES_DBYesDB name.database
POSTGRES_USERYesDB user.adventure
POSTGRES_PASSWORDYesDB password.changeme123

🔒 Backend (server)

NameRequiredDescriptionDefault Value
SECRET_KEYYesDjango secret key. Change this in production!changeme123
DJANGO_ADMIN_USERNAMEYesDefault Django admin username.admin
DJANGO_ADMIN_PASSWORDYesDefault Django admin password.admin
DJANGO_ADMIN_EMAILYesDefault admin email.admin@example.com
PUBLIC_URLYesPublicly accessible URL of the backend. Used for generating image URLs.http://localhost:8016
CSRF_TRUSTED_ORIGINSYesComma-separated list of frontend/backend URLs that are allowed to submit requests.http://localhost:8016,http://localhost:8015
FRONTEND_URLYesURL to the frontend, used for email generation.http://localhost:8015
BACKEND_PORTYesPort that the backend will run on inside Docker.8016
DEBUGNoShould be False in production.False
ENABLE_RATE_LIMITSNoEnable rate limits on the backend. Should be True in production.False

Optional Configuration

Running the containers

Validate and start:

bash
bash scripts/validate-env.sh
docker compose --env-file .env.advanced -f docker/docker-compose.advanced.yml up -d --wait

Open http://localhost:8015 (or your configured ORIGIN / SITE_URL).

Default admin login: admin / admin — change this after first login.

Next steps