forked from CenterForOpenScience/SHARE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (44 loc) · 1.5 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM python:3.5-slim
RUN apt-get update \
&& apt-get install -y \
ca-certificates \
gcc \
git \
libev4 \
libev-dev \
libevent-dev \
libxml2-dev \
libxslt1-dev \
libffi-dev \
# psycopg2
python-dev \
libpq-dev \
&& apt-get clean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# grab gosu for easy step-down from root
ENV GOSU_VERSION 1.9
RUN apt-get update \
&& apt-get install -y \
curl \
&& gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
&& gpg --verify /usr/local/bin/gosu.asc \
&& rm /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& apt-get clean \
&& apt-get autoremove -y \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN update-ca-certificates
RUN mkdir -p /code
WORKDIR /code
RUN pip install -U pip
COPY ./requirements.txt /code/requirements.txt
COPY ./constraints.txt /code/constraints.txt
RUN pip install --no-cache-dir -c /code/constraints.txt -r /code/requirements.txt
RUN apt-get remove -y gcc
COPY ./ /code/
RUN python manage.py collectstatic --noinput
CMD ["python", "manage.py", "--help"]