Docker Compose

Docker Compose を使って Roboflow inference server を他の docker コンテナと並行して実行し、マルチコンテナアプリケーションを構築します。

Roboflowのinferenceコンテナと並行して他のDockerコンテナを実行したい場合は、次を使用して実行できます: Docker Compose。以下は例のdocker-compose.yamlファイルで説明しています:

# Roboflow Inference ServiceをDocker composeサービスとして実行する
services:
  roboflow-inference-service:
    image: roboflow/inference-server:cpu
    ports:
      - "9001:9001"

# 必要に応じて、ここに他のコンテナやサービスを追加できます、 
# 以下の例で示しています;
# これによりアプリケーションの必要に応じてroboflow inferenceと複数のサービスを「compose」できます 
# service  as needed by your application

  another-container-service:
    image:  curlimages/curl:8.00.1
    entrypoint:
      - /bin/ash
      - -c
      - |
        while true; do 
        curl -s -X GET http://roboflow-inference-service:9001 
        sleep 5; 
        done
      
    depends_on:
      - roboflow-inference-service
  

ファイルを保存したら、ターミナルで次を入力します。 docker-compose up 。2つのdockerコンテナが起動します — roboflow inference serverと別のコンテナで、 curls このコンテナは5秒ごとにinferenceサーバーにアクセスします。

この例を拡張して、アプリケーションの必要に応じてスタックにさらに多くのコンテナを追加できます。

Last updated

Was this helpful?