将 docker 运行 命令(tensorflow-serving)翻译成 docker-compose

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

这里是 docker 运行 命令:

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

这是我尝试过的方法,但我无法让 MODEL_NAME 正常工作

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