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

260
Views
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?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

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.

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!