services:
  next-terminal:
    image: dushixiang/next-terminal:latest
    container_name: ${CONTAINER_NAME}
    restart: always
    networks:
      - 1panel-network
    ports:
      - "${PANEL_APP_PORT_HTTP}:8088"
      - "${PANEL_APP_PORT_SSH}:2022"
      - "${PANEL_APP_PORT_PROXY_HTTP}:80"
      - "${PANEL_APP_PORT_PROXY_HTTPS}:443"
    volumes:
      - "/etc/localtime:/etc/localtime"
      - "${DATA_PATH}:/usr/local/next-terminal/data"
      - ./logs:/usr/local/next-terminal/logs
      - ./config.yaml:/etc/next-terminal/config.yaml
    depends_on:
      - postgresql
      - guacd

    labels:  
      createdBy: "Apps"
  postgresql:
    container_name: postgresql-${CONTAINER_NAME}
    image: registry.cn-beijing.aliyuncs.com/dushixiang/postgres:16.4
    networks:
      - 1panel-network
    environment:
      POSTGRES_DB: next-terminal
      POSTGRES_USER: next-terminal
      POSTGRES_PASSWORD: next-terminal
    volumes:
      - ./data/postgresql:/var/lib/postgresql/data
    restart: always

  guacd:
    container_name: guacd-${CONTAINER_NAME}
    image: dushixiang/guacd:latest
    restart: always
    networks:
      - 1panel-network
    volumes:
      - "${DATA_PATH}:/usr/local/next-terminal/data"

    environment:
      - GUACD_LOG_LEVEL=debug
    labels:  
      createdBy: "Apps"

networks:  
  1panel-network:  
    external: true