services:
  sftpgo:
    image: icontainer/sftpgo:v2.6.6-distroless
    container_name: ${CONTAINER_NAME}
    networks:
      - icontainer-network
    ports:
      - ${PANEL_APP_PORT_HTTP}:8080
      - ${PANEL_APP_PORT_SFTP}:${PANEL_APP_PORT_SFTP}
      - ${PANEL_APP_PORT_FTP}:${PANEL_APP_PORT_FTP}
      - ${PASSIVE_PORT_RANGE_START}-${PASSIVE_PORT_RANGE_END}:${PASSIVE_PORT_RANGE_START}-${PASSIVE_PORT_RANGE_END}
      - ${PANEL_APP_PORT_WEBDAV}:${PANEL_APP_PORT_WEBDAV}
    environment:
      SFTPGO_DEFAULT_ADMIN_USERNAME: ${PANEL_APP_ADMIN_USERNAME_FTP}
      SFTPGO_DEFAULT_ADMIN_PASSWORD: ${PANEL_APP_ADMIN_PASSWORD_FTP}
      SFTPGO_HTTPD__BINDINGS__0__ADDRESS: "0.0.0.0"
      SFTPGO_HTTPD__BINDINGS__0__ENABLE_REST_API: "true"
      SFTPGO_FTPD__BINDINGS__0__PORT: ${PANEL_APP_PORT_FTP}
      SFTPGO_WEBDAVD__BINDINGS__0__PORT: ${PANEL_APP_PORT_WEBDAV}
      SFTPGO_SFTPD__BINDINGS__0__PORT: ${PANEL_APP_PORT_SFTP}
      SFTPGO_FTPD__BINDINGS__0__FORCE_PASSIVE_IP: ${FTP_EXTERNAL_IP}
      SFTPGO_FTPD__PASSIVE_PORT_RANGE__START: ${PASSIVE_PORT_RANGE_START}
      SFTPGO_FTPD__PASSIVE_PORT_RANGE__END: ${PASSIVE_PORT_RANGE_END}
    volumes:
      - ./data/data:/srv/sftpgo
      - ./data/config:/var/lib/sftpgo
      - /home/:/home
      - ${PANEL_WEBSITE_DIR}:/www/
    labels:
      createdBy: "icontainer"
networks:
  icontainer-network:
    external: true