2017-06-15 21:32:30 +03:00
|
|
|
FROM debian:jessie
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE 1
|
|
|
|
|
|
|
|
EXPOSE 8000
|
|
|
|
|
2017-06-23 15:49:32 +03:00
|
|
|
RUN useradd --uid 1000 --no-create-home --home-dir /app webdev
|
2017-06-15 21:32:30 +03:00
|
|
|
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends build-essential python3 python3-dev python3-pip \
|
2017-06-23 03:29:59 +03:00
|
|
|
libpq-dev postgresql-client gettext curl && \
|
2017-06-15 21:32:30 +03:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10
|
|
|
|
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10
|
|
|
|
|
|
|
|
|
|
|
|
# Using PIL or Pillow? You probably want to uncomment next line
|
|
|
|
# RUN apt-get update && apt-get install -y --no-install-recommends libjpeg8-dev
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# Get pip8
|
|
|
|
COPY bin/pipstrap.py bin/pipstrap.py
|
|
|
|
RUN ./bin/pipstrap.py
|
|
|
|
|
|
|
|
# First copy requirements.txt and peep so we can take advantage of
|
|
|
|
# docker caching.
|
|
|
|
COPY requirements.txt /app/requirements.txt
|
|
|
|
RUN pip install --require-hashes --no-cache-dir -r requirements.txt
|
|
|
|
|
2017-07-06 21:53:26 +03:00
|
|
|
COPY bin /app/bin
|
|
|
|
COPY missioncontrol /app/missioncontrol
|
|
|
|
COPY manage.py setup.py tox.ini /app/
|
|
|
|
|
2017-06-23 03:29:59 +03:00
|
|
|
RUN chown webdev:webdev -R .
|
2017-06-15 21:32:30 +03:00
|
|
|
USER webdev
|
2017-06-23 03:29:59 +03:00
|
|
|
|
|
|
|
# Using /bin/bash as the entrypoint works around some volume mount issues on Windows
|
|
|
|
# where volume-mounted files do not have execute bits set.
|
|
|
|
# https://github.com/docker/compose/issues/2301#issuecomment-154450785 has additional background.
|
|
|
|
ENTRYPOINT ["/bin/bash", "/app/bin/run"]
|
|
|
|
|
|
|
|
CMD ["web"]
|