Skip to content

Instantly share code, notes, and snippets.

@eduzen
Created May 19, 2019 18:33
Show Gist options
  • Save eduzen/19d27b5327f0f7204b3b318cbe2e07de to your computer and use it in GitHub Desktop.
Save eduzen/19d27b5327f0f7204b3b318cbe2e07de to your computer and use it in GitHub Desktop.
Dockerfile for Django app with alpine
FROM python:3.7-alpine
COPY requirements.txt requirements_dev.txt ./
RUN apk add --update --no-cache --virtual .build-deps \
build-base \
postgresql-dev \
libffi-dev \
python3-dev \
libffi-dev \
jpeg-dev \
zlib-dev \
musl-dev \
libpq
RUN pip install --no-cache-dir -r requirements_dev.txt
WORKDIR /code
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONPATH /code:$PYTHONPATH
EXPOSE 8080
COPY . /code/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment