This guide explains every configuration value in the docker-compose.yml file for Scatola Magica.
services:
scatola-magica:
image: ghcr.io/fccview/scatola-magica:latest
container_name: scatola-magica
user: "1000:1000"
ports:
- "1133:3000"
volumes:
- ./uploads:/app/data/uploads:rw
- ./config:/app/data/config:rw
- ./cache:/app/.next/cache:rw
restart: unless-stopped
environment:
- NODE_ENV=production
# platform: linux/arm64note: Scroll down if you are running this with podman or via rootless docker
image: ghcr.io/fccview/scatola-magica:latestSpecifies the Docker image to use. This pulls the latest stable version of Scatola Magica from GitHub Container Registry. You can use latest, main, develop (for beta features when available) and the specific tag numbers for amd/arm specifically.
container_name: scatola-magicaSets a custom name for the running container. This makes it easier to manage with docker commands.
user: "1000:1000"Runs the container with the specified user and group ID. This should match your host system user for proper file permissions.
userns_mode: keep-idRequired for Podman and rootless Docker environments. This option preserves the user namespace when mounting volumes, ensuring the container user (1000:1000) can properly access mounted directories.
When you need this option:
- Running with Podman instead of Docker
- Running Docker in rootless mode
- Getting permission denied errors when writing to mounted volumes (e.g.,
EACCES: permission denied, open '/app/data/uploads/temp/file.txt')
Why it's needed: In rootless environments, the container user cannot become root to access mounted volumes. The userns_mode: keep-id option maps the container user's UID/GID directly to the host's UID/GID, allowing proper file access. More info here
ports:
- "1133:3000"Maps host port 1133 to container port 3000. You can change 1133 to any available port on your host system.
volumes:
- ./uploads:/app/data/uploads:rw
- ./config:/app/data/config:rw
- ./cache:/app/.next/cache:rwMounts host directories into the container for persistent data storage. Here's some details:
- ./uploads:/app/data/uploads:rwMounts your localuploadsdirectory to/app/data/uploadsinside the container with read-write permissions. This stores all uploaded files and folders.- ./config:/app/data/config:rwMounts your localconfigdirectory to/app/data/configinside the container with read-write permissions. This contains user data, preferences, sessions, and avatars.- ./cache:/app/.next/cache:rwOptional mount for Next.js build cache. Improves performance by persisting cache between container restarts.
restart: unless-stoppedAutomatically restarts the container unless it was explicitly stopped. Ensures your app stays running.
environment:
- NODE_ENV=production
- HTTPS=true
- APP_URL=https://your-scatola-magica-domain.com
- OIDC_ISSUER=<YOUR_SSO_ISSUER>
- OIDC_CLIENT_ID=<YOUR_SSO_CLIENT_ID>
- DATABASE_URL=file:/data/scatola.db
- UPLOAD_DIR=/data/uploads
- MAX_CHUNK_SIZE=104857600
- PARALLEL_UPLOADS=12
- MAX_FILE_SIZE=0- NODE_ENV=productionSets the Node.js environment to production mode for optimal performance and security.- HTTPS=trueOptional. Enables HTTPS mode for secure connections.- APP_URL=https://your-scatola-magica-domain.comBase URL of your Scatola Magica instance. Required for secure session (https) and SSO.- DATABASE_URL=file:/data/scatola.dbSQLite database file location for storing metadata.- UPLOAD_DIR=/data/uploadsDirectory where uploaded files are stored.- MAX_CHUNK_SIZE=104857600Maximum chunk size for resumable uploads (100MB default).- PARALLEL_UPLOADS=12Number of parallel upload streams allowed.- MAX_FILE_SIZE=0Maximum file size limit (0 = unlimited).
- OIDC_ISSUER=<YOUR_SSO_ISSUER>URL of your OIDC provider (e.g., Authentik, Auth0, Keycloak).- OIDC_CLIENT_ID=<YOUR_SSO_CLIENT_ID>Client ID from your OIDC provider configuration.- OIDC_CLIENT_SECRET=your_client_secretOptional. Client secret for confidential OIDC client authentication.- OIDC_ADMIN_GROUPS=adminsOptional. Comma-separated list of OIDC groups that should have admin privileges.
platform: linux/arm64Optional. Specifies the target platform. Uncomment this line if running on ARM64 systems (like Apple Silicon Macs or Raspberry Pi).
For local testing without deploying images, you can use the provided docker-compose.test.yml:
# Build and run locally
docker compose -f docker-compose.test.yml up --build
# Or run in background
docker compose -f docker-compose.test.yml up -d --buildThis builds the image from your local source code instead of pulling from the registry.