Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ ENCRYPTION_KEY=change-me
# TZ=Europe/Berlin


# Staging directory for resumable (tus) uploads of very large files. Files live
# here only until they are moved into storage, then are deleted. Defaults to
# ./data/tus-incoming; put it on a persistent volume so an interrupted upload can
# resume after a restart.
# TUS_DIR=/data/tus-incoming

# Object storage for uploaded files. Default is local disk (the uploads volume
# above). For large multi-GB modules or multi-node setups, use S3 or any
# S3-compatible service (AWS S3, MinIO, Cloudflare R2). See docs/self-hosting.md.
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ services:
# Server timezone — event times, reminders and daily plans use it.
# Set to your users' timezone; containers default to UTC otherwise.
TZ: ${TZ:-Europe/Berlin}
# Staging directory for resumable (tus) uploads (see volume below).
TUS_DIR: /data/tus-incoming
volumes:
- ${DATA_DIR:-./data}/uploads:/data/uploads
# Staging area for resumable (tus) uploads of very large files. A
# persistent volume lets an interrupted upload resume after a restart.
- ${DATA_DIR:-./data}/tus-incoming:/data/tus-incoming
depends_on:
db:
condition: service_healthy
Expand Down Expand Up @@ -55,9 +60,12 @@ services:
# environment:
# DATABASE_URL: postgres://study:${POSTGRES_PASSWORD:-study}@db:5432/study
# UPLOAD_DIR: /data/uploads
# # The worker finalizes resumable (tus) uploads, so it needs the staging dir.
# TUS_DIR: /data/tus-incoming
# TZ: ${TZ:-Europe/Berlin}
# volumes:
# - ${DATA_DIR:-./data}/uploads:/data/uploads
# - ${DATA_DIR:-./data}/tus-incoming:/data/tus-incoming
# depends_on:
# db:
# condition: service_healthy
Expand Down
10 changes: 6 additions & 4 deletions docs/self-hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ Update with `docker compose pull && docker compose up -d`. Images are built for
`docker compose` mounts two directories from the **host** into the
containers, so your data survives container restarts/rebuilds:

| Host path (default) | Container path | Contents |
| ------------------- | ----------------- | ------------------------------------------------------------------------------------------- |
| `./data/db` | Postgres data dir | Everything except files: users, modules, flashcards, grades, events, chat history, settings |
| `./data/uploads` | `/data/uploads` | Uploaded files (PDFs, images, …) |
| Host path (default) | Container path | Contents |
| --------------------- | -------------------- | ------------------------------------------------------------------------------------------- |
| `./data/db` | Postgres data dir | Everything except files: users, modules, flashcards, grades, events, chat history, settings |
| `./data/uploads` | `/data/uploads` | Uploaded files (PDFs, images, …) |
| `./data/tus-incoming` | `/data/tus-incoming` | Staging for in-flight resumable (tus) uploads — transient; cleared once finalized |

By default both live under `./data`, next to `docker-compose.yml`. To store
them elsewhere — a separate disk, a NAS mount, outside the git checkout —
Expand Down Expand Up @@ -88,6 +89,7 @@ and links to the release. Installing it is a manual
| `STUDYHELPER_VERSION` | no | Image tag to run (default `latest`); pin e.g. `1.0.0` for reproducible deploys |
| `DATA_DIR` | no | Host directory for the database + uploads volumes (default `./data`, next to `docker-compose.yml`) — see [Where data is stored](#where-data-is-stored) |
| `UPLOAD_DIR` | no | Upload path **inside the container** (default `/data/uploads`) — only relevant for non-Docker deployments; Docker users should set `DATA_DIR` instead |
| `TUS_DIR` | no | Staging dir for resumable (tus) uploads of very large files (default `<cwd>/data/tus-incoming`); use a persistent volume so interrupted uploads resume after a restart |
| `STORAGE_DRIVER` | no | Where uploaded files live: `local` (default, disk under `UPLOAD_DIR`) or `s3` (S3 / S3-compatible object storage) — see [Object storage (S3)](#object-storage-s3) |
| `WORKERS_IN_PROCESS` | no | `false` runs background jobs only in a separate worker process (`npm run worker`) instead of the web tier (default `true` — in-process) |
| `SEED_TEST_DATA` | no | `true` seeds demo accounts (admin@example.com / admin-test-1234, user@example.com / user-test-1234) with sample study content on startup — for evaluation only, never in production |
Expand Down
Loading
Loading