Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

682
Views
ModuleNotFoundError: ningún módulo llamado 'app' fastapi docker
FROM python:3.8 WORKDIR /app COPY requirements.txt / RUN pip install --requirement /requirements.txt COPY ./app /app EXPOSE 8000 CMD ["uvicorn", "app.main:app", "--host=0.0.0.0" , "--reload" , "--port", "8000"]

cuando yo usaba

ventana acoplable-componer hasta -d
ModuleNotFoundError: ningún módulo llamado 'aplicación'

  • las carpetas en el marco Fastapi:

  • fastapi

    • aplicación

      -principal.py

  •  language_detector.py
  • Dockerfile

  • docker-compose

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

CMD ["uvicorn", "main:app", "--host=0.0.0.0" , "--reload" , "--port", "8000"]

Su directorio de trabajo es /app y el archivo main.py ya está allí. Por lo tanto, no necesita llamar al módulo app.main. Simplemente llame al script main.py directamente en CMD.

over 4 years ago · Santiago Trujillo Report

0

Intenta crear la carpeta /app antes

 FROM python:3.8 RUN mkdir -p /app WORKDIR /app COPY requirements.txt / RUN pip install --requirement /requirements.txt COPY ./app /app EXPOSE 8000 CMD ["uvicorn", "app.main:app", "--host=0.0.0.0" , "--reload" , "--port", "8000"]

Y lanzarlo:

ventana acoplable-componer --construir

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!