Deploy Mandolin on its own
Mandolin processes untrusted files and has no authentication. It must not be exposed to the Internet, and should only be reachable by the services using it.
This guide shows how to run Mandolin on its own, with Docker Compose. You don't need it to use Mandolin with Colander: both Colander deployment methods deploy Mandolin for you.
Requirements
Docker and Docker Compose must be installed on the machine hosting Mandolin.
Deploy Mandolin on its own
1. Create the Docker Compose file
Save the following content in a file named docker-compose.yml:
services:
tika:
image: apache/tika:3.0.0.0-full
restart: unless-stopped
healthcheck:
test: [ "CMD", "wget", "-O", "/dev/null", "http://localhost:9998/tika" ]
interval: 30s
timeout: 20s
retries: 3
clamav:
mem_reservation: 262144000
mem_limit: 1048576000
image: ajilaag/clamav-rest
healthcheck:
test: [ "CMD", "wget", "-O", "/dev/null", "http://localhost:9000/" ]
interval: 30s
timeout: 20s
retries: 3
mandolin:
image: ghcr.io/piroguetoolsuite/mandolin:main
restart: unless-stopped
ports:
- "127.0.0.1:8888:8000"
depends_on:
clamav:
condition: service_healthy
tika:
condition: service_healthy
healthcheck:
test: [ "CMD", "wget", "-O", "/dev/null", "http://localhost:8000/" ]
interval: 30s
timeout: 20s
retries: 3
environment:
- TIKA_URL=http://tika:9998/
- CLAMAV_URL=http://clamav:9000
- MAX_FILE_SIZE=250000000 # 250MB
The example publishes the port on 127.0.0.1 only. Change it if other machines have to reach Mandolin, and restrict access with a firewall.
2. Start Mandolin
docker compose up -d
3. Check that Mandolin is running
curl http://127.0.0.1:8888/
The answer is {"msg":"Finely slice your files"}.
The environment variables of the mandolin service are described in Configuration.
Update Mandolin
docker compose pull
docker compose up -d
Stop Mandolin
docker compose stop
Use it with Colander
To make Colander use a Mandolin deployed separately, set MANDOLIN_BASE_URL to its address in the configuration of Colander, see Configuration. With Docker Compose, it is a setting of the .env file.