Added docker functionality.

This commit is contained in:
Aodhan
2025-06-25 22:26:49 +01:00
parent c5391a957d
commit 7bebc95c09
8 changed files with 126 additions and 11 deletions

View File

@@ -8,22 +8,31 @@ import os
# Base directory of the repo (this file lives in the project root)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# Paths to the folders that contain source images. Add as many as you like.
IMAGE_DIRS = [
"/mnt/secret-items/sd-outputs/Sorted/Images/Portrait",
"/mnt/secret-items/sd-outputs/Sorted/Images/Landscape",
# Paths to the folders that contain source images. Can be overridden at runtime
# via the IMAGE_DIRS environment variable (colon-separated paths).
_IMAGE_DIRS_DEFAULT = [
"/media/Portrait",
"/media/Landscape",
]
# Backwards-compatibility: first directory
IMAGE_DIR = IMAGE_DIRS[0]
_IMAGE_DIRS_ENV = os.getenv("IMAGE_DIRS")
if _IMAGE_DIRS_ENV:
IMAGE_DIRS = _IMAGE_DIRS_ENV.split(":")
else:
IMAGE_DIRS = _IMAGE_DIRS_DEFAULT
# Backwards-compatibility: first directory
IMAGE_DIR = IMAGE_DIRS[0] if IMAGE_DIRS else ""
from typing import Optional
# SQLite database file that stores selections & metadata
DB_PATH = os.path.join(BASE_DIR, "image_selections.db")
# Data directory (override with DATA_DIR env var)
DATA_DIR = os.getenv("DATA_DIR", BASE_DIR)
# Default port for the HTTP server
PORT = 8000
# SQLite database file that stores selections & metadata
DB_PATH = os.path.join(DATA_DIR, "image_selections.db")
# Default port for the HTTP server (override with PORT env var)
PORT = int(os.getenv("PORT", 8888))
# ---------------------------------------------------------------------------
# NSFW detection configuration