Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

251
Vistas
Django rest project dockerfile

I am absolutely new to docker. I have an existing Django Rest project whose structure looks like following:

enter image description here

My requirements.txt:

django==1.8.8
djangorestframework
markdown
django-filter
django-rest-auth       
django-cors-headers
django-secure
django-sslserver
django-rest-auth[extras]

Normally I create a virtual env > activate it > do pip install requirements.txt and additionally I need easy_install mysql-python to get started.

I want to dockerize this project. Can someone help me build a simple docker file this project?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

As @DriesDeRydt suggest in his comment, in the provided link there is a very simple example of a docker file which installs requirements:

Add the following content to the Dockerfile.

FROM python:2.7  
ENV PYTHONUNBUFFERED 1  
RUN mkdir /code  
WORKDIR /code  
ADD requirements.txt /code/  
RUN pip install -r requirements.txt 
ADD . /code/

This Dockerfile starts with a Python 2.7 base image. The base image is modified by adding a new code directory. The base image is further modified by installing the Python requirements defined in the requirements.txt file.

You can change the image to fit your needed python version, by pulling the needed python image. For example:

FROM python:2.7 change to FROM python:3.5 or FROM python:latest

But as the above Dockerfile stands and assuming that you will place it inside the server folder, it will work for a test case.

Here is the Dockerfile documentation for further reading.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda