version: "3.7"

services:
  nginxsrv:
    image: nginx:alpine
    ports:
      - "8080:8080"
      - "443:443"
    volumes:
      - $PWD/conf/etc/localtime:/etc/localtime:ro
      - $PWD:/var/www/html
      - /Volumes/Transcend/upload:/var/www/html/data/upload
      - $PWD/conf/nginx/cert:/etc/nginx/cert
      - $PWD/conf/nginx/nginx-debug-http.conf:/etc/nginx/nginx.conf:ro
    links:
      - mobilesrv
      - fpmsrv
    container_name: "panda-nginx"
    command: [nginx,'-g','daemon off;']

  redisrv:
    image: redis:alpine
    ports:
      - "6380:6379"
    volumes:
      - $PWD/conf/etc/localtime:/etc/localtime:ro
      - $PWD/conf/redis/6379.conf:/usr/local/etc/redis/redis.conf
      - $PWD/conf/redis:/var/redis
    container_name: "panda-redis"
    command: [ "redis-server"]

  mobilesrv:
    image: php-zts-debug:7.3.18
    ports:
      - "9100:9100"
    volumes:
      - $PWD/conf/etc/localtime:/etc/localtime:ro
      - $PWD:/var/www/html
      - $PWD/conf/php/php-debug.ini:/usr/local/etc/php/php.ini
      - /Volumes/Transcend/upload:/var/www/html/data/upload
      - $PWD/conf/php/docker-php-spwan-start:/usr/local/bin/docker-php-spwan-start
    links:
      - redisrv
    container_name: "panda-mobile"
    command: ['docker-php-spwan-start']
    depends_on:
      - "redisrv"
      - "SearchSrv"
    #docker run -it -v $PWD:/var/www/html -v $PWD/conf/php/php-debug.ini:/usr/local/etc/php/php.ini -p 9100:9100 --name mobilesrv  php-zts-debug:7.3.18
    #spawn-fcgi -a 127.0.0.1 -p 9100 -F 1 -f "php /var/www/html/fcgi_run.php"

  fpmsrv:
      image: php-fpm:alpine
      ports:
        - "9000:9000"
      volumes:
        - $PWD/conf/etc/localtime:/etc/localtime:ro
        - $PWD:/var/www/html
        - /Volumes/Transcend/upload:/var/www/html/data/upload
        - $PWD/conf/php-fpm/php-debug.ini:/usr/local/etc/php/php.ini
        - $PWD/conf/php-fpm/php-fpm.conf:/usr/local/etc/php-fpm.conf
        - $PWD/conf/php-fpm/docker-php-fpm-start:/usr/local/bin/docker-php-fpm-start
      container_name: "panda-web"
      command: [docker-php-fpm-start]
      depends_on:
        - "redisrv"
        - "SearchSrv"
      #docker run -it -v $PWD:/var/www/html -v $PWD/conf/php/php-debug.ini:/usr/local/etc/php/php.ini -p 9000:9000
      #--name websrv  php-fpm:alpine

  phpcli:
    image: php-zts-debug:7.3.18
    volumes:
      - $PWD/conf/etc/localtime:/etc/localtime:ro
      - $PWD/conf/php/php-debug.ini:/usr/local/etc/php/php.ini
      - $PWD:/var/www/html
      - /Volumes/Transcend/upload:/var/www/html/data/upload
    links:
      - redisrv
    container_name: "panda-php"
    depends_on:
      - "redisrv"
      - "fpmsrv"
      - "SearchSrv"

  QueueSrv:
    image: php-zts-debug:7.3.18
    volumes:
      - $PWD/conf/etc/localtime:/etc/localtime:ro
      - $PWD:/var/www/html
      - /Volumes/Transcend/upload:/var/www/html/data/upload
      - $PWD/conf/php/php-debug.ini:/usr/local/etc/php/php.ini
      - $PWD/conf/queue/docker-queue-start:/usr/local/bin/docker-queue-start
    links:
      - redisrv
    container_name: "panda-queue"
    command: [docker-queue-start]
    depends_on:
      - "redisrv"

  SearchSrv:
    image: php-zts-debug:7.3.18
    volumes:
      - $PWD/conf/etc/localtime:/etc/localtime:ro
      - $PWD:/var/www/html
      - /Volumes/Transcend/upload:/var/www/html/data/upload
      - $PWD/conf/php/php-debug.ini:/usr/local/etc/php/php.ini
      - $PWD/conf/searcher/docker-search-start:/usr/local/bin/docker-start
    links:
      - redisrv
    container_name: "panda-searcher"
    command: [docker-start]
    depends_on:
      - "redisrv"

  crontabsrv:
      image: php-zts-debug:7.3.18
      volumes:
        - $PWD/conf/etc/localtime:/etc/localtime:ro
        - $PWD:/var/www/html
        - /Volumes/Transcend/upload:/var/www/html/data/upload
        - $PWD/conf/php/php-debug.ini:/usr/local/etc/php/php.ini
        - $PWD/conf/crontab/debug-root:/var/spool/cron/crontabs/root
        - $PWD/conf/crontab/docker-start:/usr/local/bin/docker-start
      links:
        - redisrv
      container_name: "panda-crontab"
      command: [docker-start]
      depends_on:
        - "redisrv"
  docker tag 39.97.239.116:5000/php-zts-debug:7.3.18 php-zts-debug:7.3.18