version: '3.7'
services:
  billetterie_postgres_demo:
    extends:
      file: ../compose/docker-compose-base.yml
      service: billetterie_postgres
    env_file: .env
#    ports:
#      - 5432:5432
    networks:
      - backend-billeterie

  billetterie_redis_demo:
    extends:
      file: ../compose/docker-compose-base.yml
      service: billetterie_redis
    networks:
      - backend-billeterie

  billetterie_django_demo:
    extends:
      file: ../compose/docker-compose-base.yml
      service: billetterie_django
    command: "bash /DjangoFiles/launch_prod.sh"
    env_file: .env

    depends_on:
      - billetterie_postgres_demo
    links:
      - billetterie_postgres_demo:billetterie_postgres
      - billetterie_redis_demo:redis
    networks:
      - frontend
      - backend-billeterie

  billetterie_celery_demo:
    extends:
      file: ../compose/docker-compose-base.yml
      service: billetterie_celery
    command: "bash /DjangoFiles/launch_celery.sh"
    env_file: .env
    depends_on:
      - billetterie_django_demo
    links:
      - billetterie_postgres_demo:billetterie_postgres
      - billetterie_redis_demo:redis
    networks:
      - frontend
      - backend-billeterie


  billetterie_nginx_demo:
    extends:
      file: ../compose/docker-compose-base.yml
      service: billetterie_nginx
#    ports:
#      - 8002:80
    env_file: .env
    depends_on:
      - billetterie_django_demo
    links:
      - billetterie_django_demo:billetterie_django
    labels:
      - traefik.enable=true
      - traefik.docker.network=frontend
      - traefik.http.routers.billeterie_nginx.tls.certresolver=myresolver
      - traefik.http.routers.billeterie_nginx.rule=Host(`m.${DOMAIN}`) || Host(`www.${DOMAIN}`) || Host(`raffinerie.${DOMAIN}`) || Host(`bisik.${DOMAIN}`) || Host(`vavangart.${DOMAIN}`) || Host(`manapany.${DOMAIN}`) || Host(`demo.${DOMAIN}`) || Host(`${DOMAIN}`)
    networks:
      - frontend

# pour demo : jturbeaux@pm.me / eiXom5mo

networks:
  frontend:
    external: true
  backend-billeterie:
    name: "backend-billeterie"

