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

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

  billetterie_django_dev:
    extends:
      file: ../compose/docker-compose-base.yml
      service: billetterie_django
    command: "sleep 30d"
    env_file: .env
    ports:
      - 8002:8002
    depends_on:
      - billetterie_postgres_dev
    links:
      - billetterie_postgres_dev:billetterie_postgres
      - billetterie_redis_dev:redis
    networks:
      - frontend
      - backend-billeterie

  billetterie_celery_dev:
    extends:
      file: ../compose/docker-compose-base.yml
      service: billetterie_celery
    command: "bash /DjangoFiles/launch_celery.sh"
    env_file: .env
    depends_on:
      - billetterie_django_dev
    links:
      - billetterie_postgres_dev:billetterie_postgres
      - billetterie_redis_dev:redis
    networks:
      - frontend
      - backend-billeterie

  billetterie_front_node_dev:
    extends:
      file: ../compose/docker-compose-base.yml
      service: billetterie_front_node
    build:
      context: ../Dockerfile_Node
      target: 'develop-stage'
    ports:
      - 8080:8080
    command: /bin/sh -c "yarn serve"
#    command: "sleep 30d"
    networks:
      - frontend

  # billetterie_nginx_dev:
  #   extends:
  #     file: ../compose/docker-compose-base.yml
  #     service: billetterie_nginx

  #   env_file: .env
  #   depends_on:
  #     - billetterie_django_dev
  #   links:
  #     - billetterie_django_dev: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"

