mirror of
https://github.com/mozilla-services/syncserver
synced 2024-11-01 03:20:32 +00:00
33 lines
962 B
Docker
33 lines
962 B
Docker
FROM python:2.7-slim
|
|
|
|
RUN groupadd --gid 1001 app && \
|
|
useradd --uid 1001 --gid 1001 --shell /usr/sbin/nologin app
|
|
|
|
ENV LANG C.UTF-8
|
|
|
|
WORKDIR /app
|
|
|
|
# S3 bucket in Cloud Services prod IAM
|
|
ADD https://s3.amazonaws.com/dumb-init-dist/v1.2.0/dumb-init_1.2.0_amd64 /usr/local/bin/dumb-init
|
|
RUN chmod +x /usr/local/bin/dumb-init
|
|
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
|
|
|
|
# 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 pip \
|
|
&& 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 \
|
|
&& apt-get clean
|
|
|
|
COPY ./syncserver /app/syncserver
|
|
COPY ./setup.py /app
|
|
RUN python ./setup.py develop
|
|
|
|
# run as non priviledged user
|
|
USER app
|