networks:
  1panel-network:
    external: true
services:
  gitea:
    container_name: gitea
    env_file:
    - ./envs/global.env
    - ./envs/gitea.env
    - .env
    environment:
    - USER_UID=1000
    - USER_GID=1000
    - DISABLE_SSH=false
    - GITEA__api__ENABLE_SWAGGER=false
    - DB_HOST=${DB_HOSTNAME}:${DB_PORT}
    - GITEA__mailer__ENABLED=${MAILER_ENABLED}
    - GITEA__mailer__SMTP_ADDR=${MAILER_SMTP_ADDR}
    - GITEA__mailer__SMTP_PORT=${MAILER_SMTP_PORT}
    - GITEA__mailer__USER=${MAILER_USER}
    - GITEA__mailer__PASSWD=${MAILER_PASSWD}
    - GITEA__mailer__FROM=${MAILER_FROM}
    - GITEA__mailer__SUBJECT_PREFIX=${MAILER_SUBJECT_PREFIX}
    - GITEA__proxy__PROXY_ENABLED=${PROXY_ENABLED}
    - GITEA__proxy__PROXY_URL=${PROXY_URL}
    - GITEA__proxy__PROXY_HOSTS=${PROXY_HOSTS}
    - GITEA__webhook__PROXY_URL=${PROXY_URL}
    - GITEA__webhook__PROXY_HOSTS=${PROXY_HOSTS}
    - GITEA__git.config__http.proxy=${PROXY_URL}
    - GITEA__git.config__https.proxy=${PROXY_URL}
    image: gitea/gitea:1.22.6
    labels:
      createdBy: Apps
    networks:
    - 1panel-network
    ports:
    - ${PANEL_APP_PORT_HTTP}:3000
    - ${PANEL_APP_PORT_SSH}:22
    restart: always
    volumes:
    - ${GITEA_ROOT_PATH}/data:/data
    - /etc/timezone:/etc/timezone:ro
    - /etc/localtime:/etc/localtime:ro
