Set up with jupyter notebook

This commit is contained in:
Ruben van de Ven 2022-11-07 15:36:31 +01:00
parent 9ceb71286c
commit c92a9fb824
3 changed files with 37 additions and 1 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
*

View File

@ -1,5 +1,6 @@
# modified from https://hub.docker.com/r/cwaffles/openpose
FROM nvidia/cuda:11.4.0-cudnn8-devel-ubuntu20.04
#FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
#get deps
RUN apt-get update && \
@ -32,10 +33,23 @@ RUN make install
RUN cp /openpose/build/python/openpose/pyopenpose.cpython-38-x86_64-linux-gnu.so /usr/local/lib/python3.8/dist-packages/
WORKDIR /usr/local/lib/python3.8/dist-packages
RUN ln -s pyopenpose.cpython-38-x86_64-linux-gnu.so pyopenpose
#RUN cp /openpose/build/python/openpose/pyopenpose.cpython-310-x86_64-linux-gnu.so /usr/local/lib/python3.10/dist-packages/
#WORKDIR /usr/local/lib/python3.10/dist-packages
#RUN ln -s pyopenpose.cpython-310-x86_64-linux-gnu.so pyopenpose
#ENV LD_LIBRARY_PATH=/openpose/build/python/openpose
RUN apt-get install -y ffmpeg
WORKDIR /openpose
# Notebook to actually run code
#RUN apt-get install -y python3-notebook
RUN pip install ipywidgets --ignore-installed
RUN pip install notebook
RUN pip install ipywebrtc
EXPOSE 8888
# Possibly, use /home/user/app & set HOME to /home/user to avoid temporary directories in the app folder (if desired)
WORKDIR /app
ENV HOME /app
#CMD ["env"]
CMD ["jupyter", "notebook", "--ip", "0.0.0.0"]

21
docker-compose.yml Normal file
View File

@ -0,0 +1,21 @@
version: "3.3"
services:
suspicion_nb:
image: suspicion_nb
restart: always
build:
context: .
dockerfile: ./Dockerfile
user: "1000:1000"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
ports:
- "8888:8888"
volumes:
- ./data:/data
- ./app:/app