version: "3"
services:
  #PHP Service
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: digitallearning-v2-prod_app:latest
    #container_name: digitallearning-v2-prod-app
    restart: unless-stopped
    tty: true
    #    expose:
    #      - 9000
    deploy:
      mode: replicated
      replicas: 20
    environment:
      SERVICE_NAME: app
      SERVICE_TAGS: dev
    working_dir: /var/www
    volumes:
      - ./:/var/www
      - ./docker/php/local.ini:/usr/local/etc/php/conf.d/local.ini
    # networks:
    #   - dl-v2-prod-network

  #Nginx Service
  webserver:
    image: nginx:1.15-alpine
    # container_name: digitallearning-v2-prod-webserver
    restart: unless-stopped
    tty: true
    # environment:
    #   - VIRTUAL_HOST=*.onlivre.ma,onlivre.ma,digitallearning.local,nouhaila.digitallearning.local,azizorgan.digitallearning.local,azizorg.digitallearning.local,dlorgorg.digitallearning.local,iliasorganization.digitallearning.local,othmane.digitallearning.local
    #   - LETSENCRYPT_HOST=onlivre.ma
    #   - LETSENCRYPT_EMAIL=master@digital-partnership.com
    ports:
      - "3030:80"
    #expose:
    # - "80"
    volumes:
      - ./:/var/www
      - ./docker/nginx/conf.d/:/etc/nginx/conf.d/
    # networks:
    #   - dl-v2-prod-network

#Docker Networks
# networks:
#   dl-v2-prod-network:
#     driver: bridge
    #external:
    #name: proxy_nginx-proxy # Reference our network that was created by Docker Compose when we launched our two main containers earlier. Name generated automatically. Use `docker network ls` to list all networks and their names.
