services:
  zitadel:
    image: ghcr.io/zitadel/zitadel:v2.71.13
    container_name: ${CONTAINER_NAME}
    restart: always
    networks: 
      - opsmind-network
    ports:
      - "${PANEL_APP_PORT_HTTP}:8080"
    command: 'start-from-init --masterkey "${ZITADEL_MASTER_KEY}" --tlsMode external'
    environment:
      ZITADEL_DATABASE_POSTGRES_HOST: ${PANEL_DB_HOST}
      ZITADEL_DATABASE_POSTGRES_PORT: 5432
      ZITADEL_DATABASE_POSTGRES_DATABASE: ${PANEL_DB_NAME}
      ZITADEL_DATABASE_POSTGRES_USER_USERNAME: ${PANEL_DB_USER}
      ZITADEL_DATABASE_POSTGRES_USER_PASSWORD: ${PANEL_DB_USER_PASSWORD}
      ZITADEL_DATABASE_POSTGRES_USER_SSL_MODE: disable
      ZITADEL_DATABASE_POSTGRES_ADMIN_USERNAME: ${PANEL_DB_USER}
      ZITADEL_DATABASE_POSTGRES_ADMIN_PASSWORD: ${PANEL_DB_USER_PASSWORD}
      ZITADEL_DATABASE_POSTGRES_ADMIN_SSL_MODE: disable
      ZITADEL_EXTERNALSECURE: false
      ZITADEL_EXTERNALDOMAIN: ${ZITADEL_EXTERNALDOMAIN}
      ZITADEL_EXTERNALPORT: 443
      ZITADEL_FIRSTINSTANCE_ORG_HUMAN_USERNAME: ${ZITADEL_FIRSTINSTANCE_ORG_HUMAN_USERNAME}
      ZITADEL_FIRSTINSTANCE_ORG_HUMAN_PASSWORD: ${ZITADEL_FIRSTINSTANCE_ORG_HUMAN_PASSWORD}
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
    labels:  
      createdBy: "Apps"
networks:
  opsmind-network:
    external: true