[Answered ]-Django rest project dockerfile

2👍

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.

Leave a comment