-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
70 lines (58 loc) · 1.7 KB
/
Copy pathDockerfile
File metadata and controls
70 lines (58 loc) · 1.7 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
65
66
67
68
69
70
FROM python:3.9
ENV DEBIAN_FRONTEND "noninteractive"
ENV TZ "America/New_York"
RUN set -x \
&& echo "Preparing system..." \
&& apt-get -y update \
&& apt-get -y install \
curl \
fuse \
git \
nginx \
&& rm -rf /var/lib/apt/lists/* \
&& pip3 install --no-cache-dir --upgrade pip
RUN set -x \
&& echo "Preparing user..." \
&& useradd -ms /bin/bash -d /app app \
&& groupadd fuse \
&& adduser app fuse \
&& mkdir -p /app /app/data /data \
&& chown -R app:app /app /data \
&& chmod og+rwx -R /var/lib/nginx /var/log/nginx
RUN set -x \
&& echo "Installing jupyter kernel..." \
&& pip3 install --no-cache-dir ipython_genutils ipykernel \
&& python3 -m ipykernel install
ADD deps.txt /app/deps.txt
RUN set -x \
&& echo "Installing system dependencies from deps.txt..." \
&& apt-get -y update \
&& apt-get -y install $(grep -v '^#' /app/deps.txt) \
&& rm -rf /var/lib/apt/lists/* \
&& rm /app/deps.txt
ADD setup.R /app/setup.R
RUN set -x \
&& echo "Setting up R with setup.R..." \
&& R -e "source('/app/setup.R')" \
&& rm /app/setup.R
ADD requirements.txt /app/requirements.txt
RUN set -x \
&& echo "Installing python dependencies from requirements.txt..." \
&& pip3 install --no-cache-dir -r /app/requirements.txt \
&& rm /app/requirements.txt \
&& playwright install chromium
USER app
WORKDIR /app
EXPOSE 5000
VOLUME /app/data
ENV APPYTER_PREFIX "/"
ENV APPYTER_HOST "0.0.0.0"
ENV APPYTER_PORT "5000"
ENV APPYTER_DEBUG "false"
ENV APPYTER_IPYNB "main.ipynb"
ENV APPYTER_PROFILE "bootstrap"
ENV APPYTER_EXTRAS '["toc", "toggle-code", "hide-code"]'
ENV PATH "/app:$PATH"
ENV PYTHONPATH "/app:$PYTHONPATH"
COPY --chown=app:app . /app
CMD [ "appyter", "flask-app" ]