Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Slim version
- FROM python:2.7-slim
- MAINTAINER Nick Janetakis <nick.janetakis@gmail.com>
- RUN apt-get update && apt-get install -qq -y \
- build-essential libpq-dev libffi-dev --no-install-recommends
- ENV INSTALL_PATH /bsawf
- RUN mkdir -p $INSTALL_PATH
- WORKDIR $INSTALL_PATH
- COPY requirements.txt requirements.txt
- RUN pip install -r requirements.txt
- COPY . .
- CMD gunicorn -b 0.0.0.0:8000 --access-logfile - "bsawf.app:create()"
- ### Alpine based Dockerfile
- FROM python:2.7-alpine
- MAINTAINER Nick Janetakis <nick.janetakis@gmail.com>
- RUN apk update && apk add build-base postgresql-dev libffi-dev
- ENV INSTALL_PATH /bsawf
- RUN mkdir -p $INSTALL_PATH
- WORKDIR $INSTALL_PATH
- COPY requirements.txt requirements.txt
- RUN pip install -r requirements.txt
- COPY . .
- CMD gunicorn -b 0.0.0.0:8000 --access-logfile - "bsawf.app:create()"
- ### Optimized Alpine based Dockerfile
- FROM python:2.7-alpine
- MAINTAINER Nick Janetakis <nick.janetakis@gmail.com>
- ENV INSTALL_PATH /bsawf
- RUN mkdir -p $INSTALL_PATH
- WORKDIR $INSTALL_PATH
- COPY requirements.txt requirements.txt
- RUN apk add --no-cache --virtual .build-deps \
- build-base postgresql-dev libffi-dev \
- && pip install -r requirements.txt \
- && 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
- COPY . .
- CMD gunicorn -b 0.0.0.0:8000 --access-logfile - "bsawf.app:create()"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement