Dockerfile 1.07 KB
Newer Older
guglielmo's avatar
guglielmo committed
1 2 3
FROM python:3.6-slim

# update, upgrade and install useful tools and aliases
4
RUN apt-get -y update && apt-get install -y procps \
guglielmo's avatar
guglielmo committed
5 6 7 8 9 10 11 12 13 14 15 16 17
    && apt-get install -y --no-install-recommends apt-utils \
    && apt-get -y upgrade \
    && apt-get install -y --no-install-recommends git-core tmux vim locales\
    && apt-get install -y --no-install-recommends gcc python-dev \
    && apt-get install -y --no-install-recommends binutils
#    && rm -rf /var/lib/apt/lists/*
RUN echo 'alias ll="ls -l"' >> ~/.bashrc && echo 'alias la="ls -la"' >> ~/.bashrc

# add it locale
COPY locales.txt /etc/locale.gen
RUN locale-gen

# upgrade pip
18
RUN pip3 install --upgrade pip setuptools
guglielmo's avatar
guglielmo committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

# initialize app
RUN mkdir -p /app
WORKDIR /app

# install python requirements
COPY requirements.txt /app
RUN pip3 install -r requirements.txt

# production needs uwsgi
RUN pip3 install uwsgi

# remove gcc and builkd dependencies to keep image small
RUN apt-get purge -y --auto-remove gcc python-dev

# copy app
COPY . /app/

RUN rm /app/locales.txt

# create directory for the  uwsgi spooler (if needed)
RUN mkdir -p /var/lib/uwsgi