Skip to content

Commit 6ac4d12

Browse files
committed
Merge branch 'feature/update-dockerfile' into develop
[SVCS-583] Closes: #297
2 parents 6de8b55 + bf923a2 commit 6ac4d12

File tree

2 files changed

+22
-28
lines changed

2 files changed

+22
-28
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.git
22
*.pyc
33
**/*.pyc
4+
Dockerfile

Dockerfile

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
FROM python:3.5-slim
22

3-
RUN usermod -d /home www-data && chown www-data:www-data /home
3+
# ensure unoconv can locate the uno library
4+
ENV PYTHONPATH=/usr/lib/python3/dist-packages
45

5-
RUN apt-get update \
6+
RUN usermod -d /home www-data \
7+
&& chown www-data:www-data /home \
8+
&& apt-get update \
69
# mfr dependencies
710
&& apt-get install -y \
811
git \
@@ -19,49 +22,39 @@ RUN apt-get update \
1922
libxml2-dev \
2023
libxslt1-dev \
2124
zlib1g-dev \
22-
# unoconv dependencies
23-
&& apt-get install -y \
25+
# unoconv dependencies
2426
unoconv \
25-
# pspp dependencies
26-
&& apt-get install -y \
27+
# pspp dependencies
2728
pspp \
28-
&& apt-get clean \
29-
&& apt-get autoremove -y \
30-
&& rm -rf /var/lib/apt/lists/*
31-
32-
# grab gosu for easy step-down from root
33-
ENV GOSU_VERSION 1.4
34-
RUN apt-get update \
35-
&& apt-get install -y \
29+
# gosu dependencies
3630
curl \
31+
# gosu
32+
&& export GOSU_VERSION='1.10' \
3733
&& gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
3834
&& curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
3935
&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
4036
&& gpg --verify /usr/local/bin/gosu.asc \
4137
&& rm /usr/local/bin/gosu.asc \
4238
&& chmod +x /usr/local/bin/gosu \
39+
# /gosu
4340
&& apt-get clean \
4441
&& apt-get autoremove -y \
4542
curl \
46-
&& rm -rf /var/lib/apt/lists/*
47-
48-
# ensure unoconv can locate the uno library
49-
ENV PYTHONPATH=/usr/lib/python3/dist-packages
43+
&& rm -rf /var/lib/apt/lists/* \
44+
&& pip install -U pip \
45+
&& pip uninstall -y setuptools \
46+
&& rm -f /usr/local/lib/python3.5/site-packages/mfr-nspkg.pth \
47+
&& pip install setuptools==30.4.0 \
48+
&& mkdir -p /code
5049

51-
RUN mkdir -p /code
5250
WORKDIR /code
5351

54-
RUN pip install -U pip
55-
RUN pip uninstall -y setuptools
56-
RUN rm -f /usr/local/lib/python3.5/site-packages/mfr-nspkg.pth
57-
RUN pip install setuptools==30.4.0
58-
59-
COPY ./requirements.txt /code/
52+
COPY ./requirements.txt ./
6053

61-
RUN pip install --no-cache-dir -r /code/requirements.txt
54+
RUN pip install --no-cache-dir -r ./requirements.txt
6255

6356
# Copy the rest of the code over
64-
COPY ./ /code/
57+
COPY ./ ./
6558

6659
ARG GIT_COMMIT=
6760
ENV GIT_COMMIT ${GIT_COMMIT}
@@ -70,4 +63,4 @@ RUN python setup.py develop
7063

7164
EXPOSE 7778
7265

73-
CMD ["gosu", "nobody", "invoke", "server"]
66+
CMD ["gosu", "www-data", "invoke", "server"]

0 commit comments

Comments
 (0)