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

267
Views
Django dockerizado en Ubuntu

Estoy usando:

  1. Ubuntu 16.04.
  2. Docker versión 1.12.6.

Quiero convertir en contenedor mi aplicación Django existente, sabiendo que todo va bien en esta aplicación. => sin errores, sin errores...

Mi Dockerfile:

 FROM django ADD . /BackendServer WORKDIR /BackendServer RUN pip install -r requirements.txt CMD [ "python", "BackendServer/manage.py runserver 0.0.0.0:8000" ]

requisitos.txt

 djangorestframework gunicorn

Ahora todo va bien, excepto la última línea cuando se ejecuta el python manage.py, dice: "python: no se puede abrir el archivo 'BackendServer/manage.py runserver 0.0.0.0:8000': [Errno 2] No existe tal archivo o directorio".

Entonces, ejecuto el siguiente comando: "sudo docker run backendserver ./BackendServer/manage.py runserver 0.0.0.0:8000"

¡No tengo errores y aún así el servidor no se está ejecutando! pantalla de errores

¿Qué debo hacer para poder acceder al servidor Django? ¡¡Por favor ayuda!!

Nota adicional: aquí está la ejecución de "ls BackendServer" en el contenedor.

¡gracias de antemano!

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Ya ha cambiado el directorio a /BackendServer .

Usa esto en su lugar:

 CMD [ "python", "./manage.py runserver 0.0.0.0:8000" ]

También tenga en cuenta que docker run ejecuta sin un tty de forma predeterminada, lo que suprimirá la salida. Ejecute con -it para usar la terminal interactiva.

about 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!