missioncontrol/Dockerfile

55 строки
1.9 KiB
Docker
Исходник Обычный вид История

FROM python:3.7-slim
2017-06-15 21:32:30 +03:00
ENV PYTHONDONTWRITEBYTECODE 1
EXPOSE 8000
RUN useradd --uid 1000 --no-create-home --home-dir /app webdev
2017-06-15 21:32:30 +03:00
RUN mkdir -p \
/usr/share/man/man1 \
/usr/share/man/man2 \
/usr/share/man/man3 \
/usr/share/man/man4 \
/usr/share/man/man5 \
/usr/share/man/man6 \
/usr/share/man/man7 \
/usr/share/man/man8 && \
apt-get update && \
2017-08-31 23:13:52 +03:00
apt-get install -y --no-install-recommends build-essential libpq-dev \
2019-04-02 23:09:00 +03:00
mime-support postgresql-client gettext curl netcat && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2017-06-15 21:32:30 +03:00
# 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
# First copy requirements so we can take advantage of docker caching.
COPY requirements/*.txt /app/
# temporary workaround for the following error: ImportError: cannot import name 'Feature' from 'setuptools'
RUN pip install setuptools==45
RUN pip install --require-hashes --no-cache-dir -r all.txt
2017-06-15 21:32:30 +03:00
COPY . /app
RUN chown webdev:webdev -R .
2017-06-15 21:32:30 +03:00
USER webdev
RUN DEBUG=False SECRET_KEY=foo ALLOWED_HOSTS=localhost, PRESTO_URL=foo DATABASE_URL=sqlite:// ./manage.py collectstatic --noinput -c
# Generate gzipped versions of files that would benefit from compression, that
# WhiteNoise can then serve in preference to the originals. This is required
# since WhiteNoise's Django storage backend only gzips assets handled by
# collectstatic, and so does not affect files in the `dist/` directory.
RUN python -m whitenoise.compress dist
# 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"]