Ramses II
commited on
Commit
·
511bc62
1
Parent(s):
c520e0a
first deploy
Browse files- Dockerfile +14 -13
- entrypoint.sh +7 -0
Dockerfile
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
FROM jupyter/scipy-notebook
|
|
|
|
| 2 |
# Set the working directory to /app
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
@@ -9,27 +10,27 @@ COPY public /app/public
|
|
| 9 |
|
| 10 |
# Install the dependencies
|
| 11 |
RUN apt-get update && apt-get install -y wget nginx && pip install -r requirements.txt
|
|
|
|
| 12 |
# Copy the JupyterLab configuration file
|
| 13 |
COPY jupyter_config.py /etc/jupyterlab/jupyter_config.py
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
EXPOSE 8888
|
| 17 |
-
|
| 18 |
-
# Set the environment variables
|
| 19 |
-
ENV JUPYTERLAB_PORT=8888
|
| 20 |
-
ENV JUPYTERLAB_TOKEN=your_secret_token
|
| 21 |
-
|
| 22 |
-
# Run JupyterLab when the container starts
|
| 23 |
-
CMD ["jupyter", "lab", "--port", "8888", "--no-browser", "--allow-root"]
|
| 24 |
-
|
| 25 |
-
# Use Nginx as a reverse proxy
|
| 26 |
COPY nginx.conf /etc/nginx/nginx.conf
|
| 27 |
|
|
|
|
|
|
|
|
|
|
| 28 |
# Expose the port 7860 for Nginx
|
| 29 |
EXPOSE 7860
|
| 30 |
|
| 31 |
# Set the environment variables
|
|
|
|
|
|
|
| 32 |
ENV NGINX_PORT=7860
|
| 33 |
|
| 34 |
-
#
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM jupyter/scipy-notebook
|
| 2 |
+
|
| 3 |
# Set the working directory to /app
|
| 4 |
WORKDIR /app
|
| 5 |
|
|
|
|
| 10 |
|
| 11 |
# Install the dependencies
|
| 12 |
RUN apt-get update && apt-get install -y wget nginx && pip install -r requirements.txt
|
| 13 |
+
|
| 14 |
# Copy the JupyterLab configuration file
|
| 15 |
COPY jupyter_config.py /etc/jupyterlab/jupyter_config.py
|
| 16 |
|
| 17 |
+
# Copy the Nginx configuration file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
COPY nginx.conf /etc/nginx/nginx.conf
|
| 19 |
|
| 20 |
+
# Expose the port 8888 for JupyterLab
|
| 21 |
+
EXPOSE 8888
|
| 22 |
+
|
| 23 |
# Expose the port 7860 for Nginx
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
# Set the environment variables
|
| 27 |
+
ENV JUPYTERLAB_PORT=8888
|
| 28 |
+
ENV JUPYTERLAB_TOKEN=your_secret_token
|
| 29 |
ENV NGINX_PORT=7860
|
| 30 |
|
| 31 |
+
# Copy the entrypoint script
|
| 32 |
+
COPY entrypoint.sh /app/entrypoint.sh
|
| 33 |
+
RUN chmod +x /app/entrypoint.sh
|
| 34 |
+
|
| 35 |
+
# Run the entrypoint script when the container starts
|
| 36 |
+
ENTRYPOINT ["/app/entrypoint.sh"]
|
entrypoint.sh
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Start JupyterLab in the background
|
| 4 |
+
jupyter lab --port=${JUPYTERLAB_PORT} --no-browser --allow-root &
|
| 5 |
+
|
| 6 |
+
# Start Nginx in the foreground
|
| 7 |
+
nginx -g "daemon off;"
|