-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (48 loc) · 2.24 KB
/
Dockerfile
File metadata and controls
64 lines (48 loc) · 2.24 KB
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
56
57
58
59
60
61
62
63
64
FROM ubuntu:18.04 as builder
RUN apt-get update && apt-get install -y \
python3-dev \
python3-pip \
python3-setuptools \
python-virtualenv \
gcc \
git \
libldap2-dev \
libsasl2-dev \
build-essential \
wget
RUN mkdir -p /opt/padre/
RUN virtualenv -p /usr/bin/python3 /opt/padre/venv/
ADD . /opt/padre
RUN . /opt/padre/venv/bin/activate && pip install --cache-dir /tmp -r \
/opt/padre/requirements.txt
RUN . /opt/padre/venv/bin/activate && pip install --cache-dir /tmp /opt/padre/
RUN . /opt/padre/venv/bin/activate && \
cd /opt/padre/ && python \
/opt/padre/setup.py sdist \
-d /opt/padre/
FROM ubuntu:18.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
python3-dev \
python3-pip \
python3-setuptools \
python-virtualenv \
gcc \
git \
libldap2-dev \
libsasl2-dev \
build-essential \
wget
RUN mkdir -p /opt/padre/
COPY requirements.txt /opt/padre/requirements.txt
RUN mkdir -p /opt/padre/static/
RUN mkdir -p /etc/padre/prod/
RUN virtualenv -p /usr/bin/python3 /opt/padre/venv/
COPY --from=builder /opt/padre/*.tar.gz /opt/padre/
RUN . /opt/padre/venv/bin/activate && pip install --cache-dir /opt/padre/cache -r \
/opt/padre/requirements.txt
COPY templates/ /opt/padre/templates/
COPY scripts/start.sh /opt/padre/start.sh
RUN /opt/padre/venv/bin/pip3 install --cache-dir /opt/padre/cache /opt/padre/*.tar.gz
WORKDIR /opt/padre
CMD ["/opt/padre/start.sh"]