#!/bin/sh
set -eu

APP_DIR="$(cd "$(dirname "$0")" && pwd)"
UPLOAD_DIR="/volume2/AKA Drive/사진 받기"

/usr/local/bin/docker rm -f photoreq >/dev/null 2>&1 || true
/usr/local/bin/docker run -d \
  --name photoreq \
  --restart unless-stopped \
  -p 18082:8080 \
  --env-file "$APP_DIR/.env" \
  -e PUBLIC_BASE_URL="https://photoreq.mokaya.org" \
  -e MAX_FIELDS_SIZE_MB="2" \
  -v "$APP_DIR/data:/data" \
  -v "$UPLOAD_DIR:/uploads" \
  photoreq:latest
