-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile_python
43 lines (31 loc) · 1.48 KB
/
Dockerfile_python
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
FROM python:3.6
LABEL version="0.1" description="Installs the application of the VTNA project at the University Koblenz" maintainer="[email protected]"
USER root
# Update system and add required packages
RUN apt-get -y update && apt-get -y upgrade
RUN echo deb http://ftp.uk.debian.org/debian jessie-backports main >> /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get -y install ffmpeg
# Create user named vtna
RUN adduser --system --uid 1000 vtna
# Create folder for storing the data of the application
RUN mkdir -p /usr/src/vtna/
WORKDIR /usr/src/vtna/
# Copy the data for the frontend and the jupyter notebook
COPY frontend ./frontend
RUN chown -R vtna:1000 /usr/src/vtna/
# Change to the created user vtna
USER vtna
# Install the required python packages in the home of the user
RUN pip install --no-cache-dir -r frontend/requirements.txt --user
RUN pip install --no-cache-dir git+https://github.com/marvinf95/vtna.git --user
# Delete unnacessary files
RUN rm frontend/requirements.txt
# Add the binaries from the home of the user vtna to the path
ENV PATH="/home/vtna/.local/bin:${PATH}"
# Extensions that are needed to show widgets in the notebook
RUN jupyter nbextension enable --py widgetsnbextension --user && jupyter nbextension install --py fileupload --user && jupyter nbextension enable --py fileupload --user
# The notebook could be reached on port 8888
EXPOSE 8888
# Start the notebook in the container
CMD jupyter notebook --ip 0.0.0.0 --no-browser frontend/vtna.ipynb