version: "3"

services:
  app:
    build:
      context: .  #Find Dockerfile in its directory
      dockerfile: docker/Dockerfile # Dockerfile path
    container_name: iService3 # Container Name
    ports:
      - "8000:80" # bind ports
      - "2222:22"
      - "4443:443"
      - "3309:3306"
    volumes:
      - ./:/var/www/html # copy root directory to /var/www/html in docker container
      - ./docker/php.ini:/usr/local/etc/php/php.ini # copy php.ini
      - ./docker/my.cnf:/etc/mysql/my.cnf # copy my.cnf
      - ./docker/messenger-worker.conf:/etc/supervisor/conf.d/messenger-worker.conf # copy supervisor messenger-worker.conf
      - ./docker/redis.conf:/etc/redis/redis.conf # copy redis.conf
      - ~/.ssh/:/root/.ssh/ # copy authorized_keys from host to container
#      - ~/sites/iServiceBundle:/bundle #used for testing a local bundle. Point the first part to where the bundle is on your local system.
    entrypoint: ./docker/script.sh
    stdin_open: true
    tty: true
    restart: always
    networks:
      - app

networks:
  app:
    name: iservice3
    external: true