services:
  php:
    build:
      context: ./build
      args:
        PHP_IMAGE: 1panel/php:${PHP_VERSION}-fpm
        CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
        PHP_EXTENSIONS: ${PHP_EXTENSIONS}
        TZ: ${TZ}
    image: ${IMAGE_NAME}
    container_name: ${CONTAINER_NAME}
    restart: always
    networks:
      - 1panel-network
    volumes:
      - ${PANEL_WEBSITE_DIR}:/www/
      - ./conf/conf.d:/usr/local/etc/php/conf.d
      - ./conf/php.ini:/usr/local/etc/php/php.ini
      - ./conf/php-fpm.conf:/usr/local/etc/php-fpm.conf
      - ./log:/var/log/php
      - ./extensions:/usr/local/lib/php/extensions
      - ./supervisor/supervisord.conf:/etc/supervisord.conf
      - ./supervisor/supervisor.d/php-fpm.ini:/etc/supervisor.d/php-fpm.ini
      - ./supervisor/supervisor.d:/etc/supervisor.d
      - ./supervisor/log:/var/log/supervisor
      - ./composer:/tmp/composer
    ports:
      - 127.0.0.1:${PANEL_APP_PORT_HTTP}:9000
    labels:
      createdBy: "Apps"
    cap_add:
      - SYS_PTRACE
networks:
  1panel-network:
    external: true