Sign inSign up

shawara/django-alpine

By shawara

Updated over 5 years ago

django-alpine simple base image for django apps based on alpine python 3.6

Image
2

379

shawara/django-alpine repository overview

  • base docker pull shawara/django-alpine:base
FROM python:3.6-alpine
ENV PYTHONUNBUFFERED 1

RUN apk add --no-cache --virtual .build-deps \
    ca-certificates gcc postgresql-dev linux-headers musl-dev \
    libffi-dev jpeg-dev zlib-dev \
    && pip install psycopg2==2.8.1 Pillow==6.0.0 \
    && find /usr/local \
        \( -type d -a -name test -o -name tests \) \
        -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
        -exec rm -rf '{}' + \
    && runDeps="$( \
        scanelf --needed --nobanner --recursive /usr/local \
                | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
                | sort -u \
                | xargs -r apk info --installed \
                | sort -u \
    )" \
    && apk add --virtual .rundeps $runDeps \
    && apk del .build-deps
  • git docker pull shawara/django-alpine:git

Django Alpine base image with git installed in case you want to install python package from github directly ex : pip install -e git+https://[URL]@[CommitID]#egg=[PackageName]

details

pip install psycopg2 if you are using Postgres database, must be installed before removing .build-deps

pip install Pillow is need for Djange ImageField , it is added here to save time of downloading 27 MB and installing it multiple times .

Tag summary

Content type

Image

Digest

Size

49.3 MB

Last updated

over 5 years ago

docker pull shawara/django-alpine