Containerprozess verursacht: Exec: "Uvicorn": Ausführbare Datei, die nicht in $ path zu finden ist: UnbekanntPython

Python-Programme
Anonymous
 Containerprozess verursacht: Exec: "Uvicorn": Ausführbare Datei, die nicht in $ path zu finden ist: Unbekannt

Post by Anonymous »

Ich versuche, meine Fastapi-App zu docken, aber sie stürzt mit diesem Fehler ab, nachdem ich den Befehl ausgeführt habe: < /p>

Code: Select all

docker-compose -f local.yml up -d
Kann mir jemand helfen, bitte?

Code: Select all

FROM python:3.6.11-alpine3.11
ARG MYSQL_SERVER
ARG POSTGRES_SERVER
ENV ENVTYPE=local
ENV PYTHONUNBUFFERED 1
ENV APP_HOME=/home/app/web
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME

RUN apk update && apk add --no-cache bash
ADD /compose/scripts.sh $APP_HOME
ADD /requirements/$ENVTYPE.txt $APP_HOME
RUN chmod +x scripts.sh

RUN ./scripts.sh
RUN pip install -r /home/app/web/$ENVTYPE.txt; mkdir /log;

COPY /src/ $APP_HOME
CMD ["uvicorn", "app.main:app", "--reload", "--host", "0.0.0.0", "--port", "8080"]
Local.yml -Datei :

Code: Select all

version: '3.7'
services:
nginx:
env_file: .env
build:
context: .
dockerfile: ./compose/local/nginx.Dockerfile
restart: always
ports:
- "${EX_PORT_NGINX:-8030}:80"
volumes:
- ./nginx/site.conf:/etc/nginx/conf.d/default.conf
core:
env_file: .env
build:
context: .
dockerfile: ./compose/local/core.Dockerfile
args:
MYSQL_SERVER: ${MYSQL_SERVER:-}
POSTGRES_SERVER: ${POSTGRES_SERVER:-}
restart: always
volumes:
- ./src:/home/app/web/
logging:
driver: "json-file"
options:
max-size: "5m"
max-file: "10"
< /code>
Fehler: < /p>
Cannot start service core: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "uvicorn": executable file not found in $PATH: unknown

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post