Skip to content

Instantly share code, notes, and snippets.

@jmoz
Created October 10, 2020 06:45
Show Gist options
  • Save jmoz/eca764892443ab85623f9c86e5839f26 to your computer and use it in GitHub Desktop.
Save jmoz/eca764892443ab85623f9c86e5839f26 to your computer and use it in GitHub Desktop.
Dockerfile for Django, python-slim (requirements had Twisted which caused gcc and other errors)
FROM python:3.8-slim
ENV PYTHONUNBUFFERED=1
RUN mkdir /code
WORKDIR /code
COPY requirements.txt /code/
RUN apt-get update \
&& apt-get install -y --no-install-recommends gcc build-essential \
&& pip3 install -r requirements.txt \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get purge -y --auto-remove gcc build-essential
COPY . /code/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment