version: '2.1'

services:
  ctel:
    container_name: api
    build: .
    entrypoint: ["python3"]
    command: ["-m", "gunicorn", "fwd.asgi:application", "-k", "uvicorn.workers.UvicornWorker", "-b", "0.0.0.0"]
    ports:
      - 8001:8000
    environment:
      - MEDIA_ROOT=/app/media/  # For save file
    restart: always
  cb_driver_ls_consumer:
    container_name: driver_cb_consumer
    build: .
    entrypoint: [ "python3" ]
    command: ["/app/fwd_api/queue/call_back_consumer/driver_ls_queue.py"]
    ports:
      - 5672:5672
    environment:
      - PYTHONPATH=${PYTHONPATH}:/app  # For import module
      - PYTHONUNBUFFERED=1  # For show print log
    restart: "no"
  cb_id_card_consumer:
    container_name: id_cb_consumer
    build: .
    entrypoint: [ "python3" ]
    command: ["/app/fwd_api/queue/call_back_consumer/id_queue.py"]
#    ports:
#      - 5672:5672
    environment:
      - PYTHONPATH=${PYTHONPATH}:/app  # For import module
      - PYTHONUNBUFFERED=1  # For show print log
    restart: "no"
  cb_invoice_consumer:
    build: .
    entrypoint: [ "python3" ]
    command: [ "/app/fwd_api/queue/call_back_consumer/invoice_queue.py" ]
#    ports:
#      - 5672:5672
    environment:
      - PYTHONPATH=${PYTHONPATH}:/app  # For import module
      - PYTHONUNBUFFERED=1  # For show print log
    restart: "no"
  cb_ocr_boxing_consumer:
    build: .
    entrypoint: [ "python3" ]
    command: [ "/app/fwd_api/queue/call_back_consumer/ocr_boxing_queue.py" ]
#    ports:
#      - 5672:5672
    environment:
      - PYTHONPATH=${PYTHONPATH}:/app  # For import module
      - PYTHONUNBUFFERED=1  # For show print log
    restart: "no"

    # For mock only

  driver_ls_consumer:
    build: .
    entrypoint: [ "python3" ]
    command: [ "/app/fwd_api/queue/mock_process_consumer/driver_ls.py" ]
#    ports:
#      - 5672:5672
    environment:
      - PYTHONPATH=${PYTHONPATH}:/app  # For import module
      - PYTHONUNBUFFERED=1  # For show print log
    restart: "no"
  id_card_consumer:
    build: .
    entrypoint: [ "python3" ]
    command: [ "/app/fwd_api/queue/mock_process_consumer/id.py" ]
#    ports:
#      - 5672:5672
    environment:
      - PYTHONPATH=${PYTHONPATH}:/app  # For import module
      - PYTHONUNBUFFERED=1  # For show print log
    restart: "no"
  invoice_consumer:
    build: .
    entrypoint: [ "python3" ]
    command: [ "/app/fwd_api/queue/mock_process_consumer/invoice.py" ]
#    ports:
#      - 5672:5672
    environment:
      - PYTHONPATH=${PYTHONPATH}:/app  # For import module
      - PYTHONUNBUFFERED=1  # For show print log
    restart: "no"
  ocr_boxing_consumer:
    build: .
    entrypoint: [ "python3" ]
    command: [ "/app/fwd_api/queue/mock_process_consumer/ocr_boxing.py" ]
#    ports:
#      - 5672:5672
    environment:
      - PYTHONPATH=${PYTHONPATH}:/app  # For import module
      - PYTHONUNBUFFERED=1  # For show print log
    restart: "no"