Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +14 -12
Dockerfile
CHANGED
|
@@ -1,17 +1,19 @@
|
|
| 1 |
-
FROM jupyter/
|
| 2 |
|
| 3 |
-
# Install additional
|
| 4 |
-
RUN pip install
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM jupyter/minimal-notebook:python-3.9
|
| 2 |
|
| 3 |
+
# Install additional packages
|
| 4 |
+
RUN pip install gradio
|
| 5 |
|
| 6 |
+
# Create a very simple Python script to relay Jupyter through Gradio on port 7860
|
| 7 |
+
RUN echo "import gradio as gr; import os; os.system('jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser --NotebookApp.token=\\\"\\\" --NotebookApp.password=\\\"\\\" &'); demo = gr.Interface(fn=lambda: None, inputs=[], outputs=gr.HTML('<iframe src=\"/proxy/8888/tree\" width=\"100%\" height=\"800px\"></iframe>'), title=\"Jupyter Notebook\"); demo.launch(server_port=7860)" > /home/jovyan/relay.py
|
| 8 |
|
| 9 |
+
# Copy notebook
|
| 10 |
+
COPY welcome.ipynb /home/jovyan/
|
| 11 |
|
| 12 |
+
# Use the non-root jovyan user (comes with the Jupyter image)
|
| 13 |
+
USER jovyan
|
| 14 |
|
| 15 |
+
# Expose port 7860 (required by Hugging Face Spaces)
|
| 16 |
+
EXPOSE 7860
|
| 17 |
+
|
| 18 |
+
# Run the relay script
|
| 19 |
+
CMD ["python", "/home/jovyan/relay.py"]
|