2018-04-09 23:30:38 +00:00
|
|
|
FROM python:2.7-alpine3.7
|
2014-04-16 19:43:05 +00:00
|
|
|
|
2018-04-09 23:30:38 +00:00
|
|
|
RUN addgroup -g 1001 app \
|
|
|
|
&& adduser -u 1001 -S -D -G app -s /usr/sbin/nologin app
|
2014-04-16 19:43:05 +00:00
|
|
|
|
|
|
|
ENV LANG C.UTF-8
|
|
|
|
|
2017-05-26 01:44:36 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# install syncserver dependencies
|
|
|
|
COPY ./requirements.txt /app/requirements.txt
|
|
|
|
COPY ./dev-requirements.txt /app/dev-requirements.txt
|
2018-04-09 23:30:38 +00:00
|
|
|
RUN apk --no-cache update \
|
2018-05-06 05:51:04 +00:00
|
|
|
&& apk add dumb-init libstdc++ libffi-dev openssl-dev g++ \
|
2018-03-18 20:28:16 +00:00
|
|
|
&& pip install --upgrade pip \
|
2017-05-26 01:44:36 +00:00
|
|
|
&& pip install --upgrade --no-cache-dir -r requirements.txt \
|
|
|
|
&& pip install --upgrade --no-cache-dir -r dev-requirements.txt \
|
2018-04-09 23:30:38 +00:00
|
|
|
&& apk del g++
|
2014-04-16 19:43:05 +00:00
|
|
|
|
2017-05-26 01:44:36 +00:00
|
|
|
COPY ./syncserver /app/syncserver
|
|
|
|
COPY ./setup.py /app
|
|
|
|
RUN python ./setup.py develop
|
2014-04-16 19:43:05 +00:00
|
|
|
|
2017-05-26 01:44:36 +00:00
|
|
|
# run as non priviledged user
|
|
|
|
USER app
|
2018-04-09 23:30:38 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|