networks:
  1panel-network:
    external: true

services:
  stash:
    image: stashapp/stash:v0.29.3
    container_name: ${CONTAINER_NAME}
    labels:
      createdBy: "Apps"
    restart: always
    network_mode: ${NETWORK_MODE:-host}
    ports:
      - ${PANEL_APP_PORT_HTTP}:${PANEL_APP_PORT_HTTP}
    env_file:
      - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
      - ${ENV_FILE:-/etc/1panel/envs/default.env}
    logging:
      driver: "json-file"
      options:
        max-file: "10"
        max-size: "2m"
    volumes:
      - /etc/localtime:/etc/localtime
      - ${STASH_ROOT_PATH}/config:/root/.stash
      - ${STASH_ROOT_PATH}/data:/data
      - ${STASH_ROOT_PATH}/metadata:/metadata
      - ${STASH_ROOT_PATH}/cache:/cache
      - ${STASH_ROOT_PATH}/blobs:/blobs
      - ${STASH_ROOT_PATH}/generated:/generated
      - ${CUSTOM_MOUNT_DIRECTORY_1:-./default_mount_1}:${CUSTOM_MOUNT_DIRECTORY_1:-/default_mount_1}
      - ${CUSTOM_MOUNT_DIRECTORY_2:-./default_mount_2}:${CUSTOM_MOUNT_DIRECTORY_2:-/default_mount_2}
      - ${CUSTOM_MOUNT_DIRECTORY_3:-./default_mount_3}:${CUSTOM_MOUNT_DIRECTORY_3:-/default_mount_3}
    environment:
      - STASH_PORT=${PANEL_APP_PORT_HTTP:-9999}
      - TZ=Asia/Shanghai
      - STASH_STASH=/data/
      - STASH_GENERATED=/generated/
      - STASH_METADATA=/metadata/
      - STASH_CACHE=/cache/
      - HTTPS_PROXY=${HTTP_PROXY}
      - HTTP_PROXY=${HTTP_PROXY:-}
      - NO_PROXY=${NO_PROXY:-}
