syncserver/Dockerfile

35 lines
937 B
Docker
Raw Normal View History

FROM python:2.7-slim
2014-04-16 14:43:05 -05:00
RUN groupadd --gid 1001 app && \
useradd --uid 1001 --gid 1001 --shell /usr/sbin/nologin app
2014-04-16 14:43:05 -05:00
ENV LANG C.UTF-8
WORKDIR /app
2017-11-19 12:20:25 +01:00
# Add Tini
ENV "TINI_VERSION" "v0.16.1"
ADD "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini" "/tini"
RUN chmod +x "/tini"
ENTRYPOINT ["/tini", "--"]
# install syncserver dependencies
COPY ./requirements.txt /app/requirements.txt
COPY ./dev-requirements.txt /app/dev-requirements.txt
RUN apt-get -q update \
&& apt-get -q --yes install g++ \
&& pip install --upgrade --no-cache-dir -r requirements.txt \
&& pip install --upgrade --no-cache-dir -r dev-requirements.txt \
&& apt-get -q --yes remove g++ \
&& apt-get -q --yes autoremove \
2014-04-16 14:43:05 -05:00
&& apt-get clean
COPY ./syncserver /app/syncserver
COPY ./setup.py /app
RUN python ./setup.py develop
2014-04-16 14:43:05 -05:00
# run as non priviledged user
USER app
2017-11-19 12:20:25 +01:00
CMD [ "/usr/local/bin/gunicorn", "syncserver.wsgi_app" ]