version: '3.0' # specify docker-compose version
 
# Define the services/ containers to be run
services:
 angular: # name of the first service
  build: angular-client # specify the directory of the Dockerfile
  ports:
  - "4200:4200" # specify port mapping
 
 express: # name of the second service
  build: express-server # specify the directory of the Dockerfile
  ports:
  - "9991:9991" #specify ports mapping
  links:
  - database # link this service to the database service
 
 database: # name of the third service
  image: mongo # specify image to build container from
  ports:
  - "27017:27017" # specify port forwarding




# version: '3'

# networks:
#   private:
#   web:
#    external:
#     name: web
#   #pipeline-test-mean-stack-docker_default:
#   #pipeline-test-mean-stack-docker_private:
#   #grafana:

# #volumes:
# #  app_data: {}
# #  database:

# services:
#   express_preprod:
#     #   container_name: express_"${ENV}"
#         build: express-server
#         ports:
#           - "4000:4000"
#         networks:
#           - web
#           - private
#           #- pipeline-test-mean-stack-docker_default
#           #- pipeline-test-mean-stack-docker_private
#           #- grafana
#         volumes:
#           - /var/log:/var/www/app/log/root
#         labels:
#           - traefik.enable=true
#           - traefik.http.routers.express_preprod.rule=Host(`api-preprod.foodgame.fr`)
#     #     - traefik.http.routers.apache_prod.rule=Host(`${URLEXPRESS}`)
#           - traefik.http.services.express_preprod.loadbalancer.server.port=4000
#           - traefik.http.routers.express_preprod.entrypoints=websecure
#           - traefik.http.routers.express_preprod.tls.certresolver=myresolver
#         links:
#           - database_preprod
#         restart: always

#   database_preprod:
# #   container_name: mongo_"${ENV}"
#     image: mongo:4.4.6
#     ports:
#       - "27017:27017"
#     volumes:
#       - ./backup:/backup
#       - /var/lib/mongodb/data_preprod:/data/db
# #     - database:/data/database
#     labels:
#       - traefik.enable=true
#       - traefik.http.routers.database_preprod.rule=Host(`mongodb-preprod.foodgame.fr`)
# #     - traefik.http.routers.apache_prod.rule=Host(`${URLMONGO}`)
#       - traefik.http.services.database_preprod.loadbalancer.server.port=27017
#       - traefik.http.routers.database_preprod.entrypoints=websecure
#       - traefik.http.routers.database_preprod.tls.certresolver=myresolver  
#     networks:
#       - web
#       - private
#       #- pipeline-test-FatboarProject_default
#       #- pipeline-test-FatboarProject_private
#     restart: always

#   apache_preprod:
# #   container_name: apache_"${ENV}"    
#     build:  
#       context: ./
#      #dockerfile: build/docker/httpd/Dockerfile
#       dockerfile: build/docker/apache/Dockerfile
#     ports:
#       - "8080:80"
#     networks:
#       - web
#       - private
#       #- pipeline-test-FatboarProject_default
#       #- pipeline-test-FatboarProject_private
#     volumes:     
#       - /var/log:/var/log/apache2
#     labels:
#       - traefik.enable=true
#       - traefik.http.routers.apache_prod.rule=Host(`angular-preprod.foodgame.fr`)
# #     - traefik.http.routers.apache_prod.rule=Host(`${URLANGULAR}`)
#       - traefik.http.services.apache_prod.loadbalancer.server.port=80
#       - traefik.http.routers.apache_prod.entrypoints=websecure
#       - traefik.http.routers.apache_prod.tls.certresolver=myresolver  
#     restart: always  


 