Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/xcoder-es/media-cleaner-pro/llms.txt

Use this file to discover all available pages before exploring further.

The repository includes a docker-compose.yml that wires together the Rust API backend, an Astro frontend container, and an optional Temporal workflow cluster backed by PostgreSQL. This setup is useful for environments where you want process isolation, easy restarts, and a clean separation between the API and UI layers — or where you plan to plug in Temporal for durable, observable workflow execution.

Services Overview

The Compose file defines five services:
ServiceImage / BuildHost PortDescription
mediacleaner-apiBuilt from Dockerfile8081 → 8080The Rust processing backend; handles all pipeline logic and serves the REST API
frontendBuilt from ./frontend/Dockerfile4321 → 4321The Astro web UI; communicates with the API via PUBLIC_API_URL
temporaltemporalio/auto-setup:1.24.27233, 8233Temporal workflow server for durable job execution
temporal-uitemporalio/ui:2.51.18080 → 8080Temporal’s browser dashboard
postgresqlpostgres:16-alpine5432 → 5432PostgreSQL backing store for Temporal’s persistence layer
All services communicate over a shared mediacleaner bridge network.
The temporal, temporal-ui, and postgresql services are optional. If you only need the image cleaning pipeline, comment those three services out of docker-compose.yml and remove the depends_on: temporal block from mediacleaner-api. The API runs perfectly without a Temporal server.

Deployment

1

Clone the repository

git clone https://github.com/xcoder-es/media-cleaner-pro.git
cd media-cleaner-pro
2

Configure environment variables

Copy the example file and open it in your editor:
cp .env.example .env
At minimum, set SOURCE_DIR and DEST_DIR to the paths inside the container where your media will live. The defaults map to the ./data volume already configured in the Compose file:
SOURCE_DIR=/data/source
DEST_DIR=/data/output
Other variables you may want to adjust:
VariableDefaultDescription
RUST_LOGinfoLog verbosity (error, warn, info, debug, trace)
SERVER_HOST0.0.0.0Bind address inside the container
SERVER_PORT8080Internal HTTP port (mapped to 8081 on the host)
HAMMING_THRESHOLD4Perceptual similarity tolerance (0–64, lower = stricter)
WORKER_THREADS00 uses all available CPU cores
TEMPORAL_HOSTtemporal:7233Temporal server address (optional)
3

Mount your media directory

Open docker-compose.yml and locate the volumes block under mediacleaner-api. The file includes ready-made commented examples for each OS:
volumes:
  - ./data:/data
  # Mount your media folders for processing (pick one or add more):
  # Windows: - C:/Users/YourName/Documents/cleaned_media:/media:ro
  # macOS:   - /Users/YourName/Documents/cleaned_media:/media:ro
  # Linux:   - /home/YourName/Documents/cleaned_media:/media:ro
Uncomment and edit the line that matches your operating system, replacing the host path with the actual location of your image library. The :ro flag mounts the source as read-only so MediaCleaner Pro never modifies your originals in-place.
4

Start the stack

docker compose up -d
Docker will build the mediacleaner-api and frontend images on the first run. Subsequent starts reuse the cached layers.To follow logs from all services:
docker compose logs -f
To follow only the API:
docker compose logs -f mediacleaner-api
5

Open the interfaces

Once all containers are healthy, the following endpoints are available:
InterfaceURL
MediaCleaner APIhttp://127.0.0.1:8081
Astro Frontendhttp://127.0.0.1:4321
Temporal UIhttp://127.0.0.1:8080
The OpenAPI spec for the backend is available at http://127.0.0.1:8081/api/openapi.json.

mediacleaner-api Service Reference

The core service definition from docker-compose.yml:
mediacleaner-api:
  build:
    context: .
    dockerfile: Dockerfile
  container_name: mc-api
  restart: unless-stopped
  ports:
    - "8081:8080"
  environment:
    - RUST_LOG=info
    - SERVER_HOST=0.0.0.0
    - SERVER_PORT=8080
    - SOURCE_DIR=/data/source
    - DEST_DIR=/data/output
    - TEMPORAL_HOST=temporal:7233
  volumes:
    - ./data:/data
    # Mount your media folders for processing (pick one or add more):
    # Windows: - C:/Users/YourName/Documents/cleaned_media:/media:ro
    # macOS:   - /Users/YourName/Documents/cleaned_media:/media:ro
    # Linux:   - /home/YourName/Documents/cleaned_media:/media:ro
  depends_on:
    - temporal
  networks:
    - mediacleaner
The ./data bind mount at /data is where the API reads from SOURCE_DIR and writes organized output to DEST_DIR. Any additional media volumes you mount alongside it (e.g. /media) can then be referenced from the UI’s directory browser or set in .env.

Environment Variables

These variables are passed directly to the container via the environment block:
VariableValue in ComposeDescription
RUST_LOGinfoTracing log level for the Rust binary
SERVER_HOST0.0.0.0Binds to all interfaces inside the container
SERVER_PORT8080Internal port; mapped to 8081 on the host
SOURCE_DIR/data/sourceContainer-absolute path for input images
DEST_DIR/data/outputContainer-absolute path for organized output
TEMPORAL_HOSTtemporal:7233Resolves to the temporal service on the shared Docker network (optional)
The Dockerfile uses a multi-stage build: a rust:latest builder image compiles the binary with cargo build --release, and only the resulting executable is copied into a lean debian:bookworm-slim runtime image (with ca-certificates and libssl3). This keeps the final production image small while still supporting TLS and system certificate validation out of the box.

Build docs developers (and LLMs) love