Search code examples
dockertensorflowtensorflow-serving

translate docker run command (tensorflow-serving) into docker-compose


Here is the docker run command:

docker run -p 8501:8501 \
--name tfserving_classifier \
-e MODEL_NAME=img_classifier \
-t tensorflow/serving

Here is what I tried but I am not able to get the MODEL_NAME to work

  tensorflow-servings:
    container_name: tfserving_classifier
    ports:
      - 8501:8501
    command:
      - -e MODEL_NAME=img_classifier
      - -t tensorflow/serving

Solution

  •   tensorflow-servings:
        container_name: tfserving_classifier
        image: tensorflow/serving
        environment:
          - MODEL_NAME=img_classifier
        ports:
          - 8501:8501