1

Docker Compose を使用していくつかのコンテナーをスピンアップしていますが、うまくいきませんcommand。Flask サーバーを起動したいのですが、環境変数も設定します。これが私がやったことです:

web:
  command: INSTASONG_ENV=production python manage.py runserver

残念ながら、次のエラーが表示されます。

Cannot start container 2a413b1270b9faa5e0ffb8a70603ae25c48ff742e0d8476bed8153febcee185a: [8] System error: exec: "INSTASONG_ENV=production": executable file not found in $PATH

どうすればこれを機能させることができますか?

4

1 に答える 1

4

に示すように、環境変数の設定は異なる場合があります。tests/fixtures/extends/common.yml

web:
  image: busybox
  command: /bin/true
  environment:
    - FOO=1
    - BAR=1

あなたの場合:

web:
  command: python manage.py runserver
  environment:
    - INSTASONG_ENV=production
于 2015-04-28T20:56:09.737 に答える