forked from mozilla-services/server-syncstorage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (25 loc) · 956 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM python:2.7-alpine
WORKDIR /app
RUN addgroup -g 10001 app && \
adduser -D -u 10001 -G app -h /app -s /sbin/nologin app
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV REQUIRE_SPEEDUPS=1
# run the server by default
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["server"]
# install / cache dependencies first
COPY requirements.txt /app/requirements.txt
# install dependencies, cleanup and add libstdc++ back in since
# we the app needs to link to it
RUN apk add --update build-base postgresql-dev ca-certificates && \
pip install -r requirements.txt && \
apk del --purge build-base gcc postgresql-dev && \
apk add libstdc++
# Copy in the whole app after dependencies have been installed & cached
COPY . /app
RUN python setup.py develop && \
find /app -type d -exec chmod 755 {} \; && \
find /app -type f -exec chmod 644 {} \; && \
chmod 755 /app/docker-entrypoint.sh
# De-escalate from root privileges with app user
USER app