-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
36 lines (29 loc) · 1.2 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
FROM docker.ocf.berkeley.edu/theocf/debian:bullseye
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
cracklib-runtime \
libcrack2-dev \
libffi-dev \
libssl-dev \
python3.9-dev \
virtualenv \
rustc \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN install -d --owner=nobody /opt/slackbridge /opt/slackbridge/venv
COPY requirements.txt /opt/slackbridge/
RUN virtualenv -ppython3.9 /opt/slackbridge/venv \
&& /opt/slackbridge/venv/bin/pip install pip \
&& /opt/slackbridge/venv/bin/pip install setuptools==65.0.1 \
&& /opt/slackbridge/venv/bin/pip install \
-r /opt/slackbridge/requirements.txt
RUN chown -R nobody:nogroup /opt/slackbridge
# Run these separate from the chown before so that when developing the docker
# cached layers makes rebuilding faster since it doesn't have to chown the whole
# project again (including vendored stuff)
COPY slackbridge /opt/slackbridge/slackbridge
RUN chown -R nobody:nogroup /opt/slackbridge/slackbridge
USER nobody
WORKDIR /opt/slackbridge
CMD ["/opt/slackbridge/venv/bin/python", "-m", "slackbridge.main"]