Ramses II
commited on
Commit
•
6992e29
1
Parent(s):
60224c1
first deploy
Browse files- Dockerfile +40 -0
- jupyter_config.py +5 -0
- nginx.conf +17 -0
- public/index.html +55 -0
- requirements.txt +1 -0
Dockerfile
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM jupyterlab/jupyterlab:latest
|
2 |
+
|
3 |
+
# Set the working directory to /app
|
4 |
+
WORKDIR /app
|
5 |
+
|
6 |
+
# Copy the requirements file
|
7 |
+
COPY requirements.txt .
|
8 |
+
|
9 |
+
COPY public /app/public
|
10 |
+
|
11 |
+
# Install the dependencies
|
12 |
+
RUN pip install -r requirements.txt
|
13 |
+
|
14 |
+
# Copy the JupyterLab configuration file
|
15 |
+
COPY jupyter_config.py /etc/jupyterlab/jupyter_config.py
|
16 |
+
|
17 |
+
# Expose the port 8888 for JupyterLab (no se utiliza, solo para referencia)
|
18 |
+
EXPOSE 8888
|
19 |
+
|
20 |
+
# Set the environment variables
|
21 |
+
ENV JUPYTERLAB_PORT=8888
|
22 |
+
ENV JUPYTERLAB_TOKEN=your_secret_token
|
23 |
+
|
24 |
+
# Run JupyterLab when the container starts
|
25 |
+
CMD ["jupyter", "lab", "--port", "8888", "--no-browser", "--allow-root"]
|
26 |
+
|
27 |
+
# Use Nginx as a reverse proxy
|
28 |
+
FROM nginx:latest
|
29 |
+
|
30 |
+
# Copy the Nginx configuration file
|
31 |
+
COPY nginx.conf /etc/nginx/nginx.conf
|
32 |
+
|
33 |
+
# Expose the port 7860 for Nginx
|
34 |
+
EXPOSE 7860
|
35 |
+
|
36 |
+
# Set the environment variables
|
37 |
+
ENV NGINX_PORT=7860
|
38 |
+
|
39 |
+
# Run Nginx when the container starts
|
40 |
+
CMD ["nginx", "-g", "daemon off;"]
|
jupyter_config.py
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
c.NotebookApp.ip = '0.0.0.0'
|
2 |
+
c.NotebookApp.port = 8888
|
3 |
+
c.NotebookApp.open_browser = False
|
4 |
+
c.NotebookApp.allow_root = True
|
5 |
+
c.NotebookApp.token = 'your_secret_token'
|
nginx.conf
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
http {
|
2 |
+
server {
|
3 |
+
listen 7860;
|
4 |
+
server_name _;
|
5 |
+
|
6 |
+
location / {
|
7 |
+
root /app/public;
|
8 |
+
index index.html;
|
9 |
+
}
|
10 |
+
|
11 |
+
location /jupyter/ {
|
12 |
+
proxy_pass http://localhost:8888;
|
13 |
+
proxy_set_header Host $host;
|
14 |
+
proxy_set_header X-Real-IP $remote_addr;
|
15 |
+
}
|
16 |
+
}
|
17 |
+
}
|
public/index.html
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="es">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>File Uploader</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<style>
|
9 |
+
/* Estilo personalizado si es necesario */
|
10 |
+
.custom-file-input {
|
11 |
+
color: transparent;
|
12 |
+
}
|
13 |
+
.custom-file-input::-webkit-file-upload-button {
|
14 |
+
visibility: hidden;
|
15 |
+
}
|
16 |
+
.custom-file-input::before {
|
17 |
+
content: 'Select file';
|
18 |
+
color: white;
|
19 |
+
display: inline-block;
|
20 |
+
background: #1f2937;
|
21 |
+
border: 1px solid #4b5563;
|
22 |
+
padding: 0.5rem 1rem;
|
23 |
+
outline: none;
|
24 |
+
white-space: nowrap;
|
25 |
+
cursor: pointer;
|
26 |
+
font-weight: 700;
|
27 |
+
font-size: 1rem;
|
28 |
+
}
|
29 |
+
.custom-file-input:hover::before {
|
30 |
+
border-color: #9ca3af;
|
31 |
+
}
|
32 |
+
</style>
|
33 |
+
</head>
|
34 |
+
<body class="bg-gray-900 text-white flex items-center justify-center min-h-screen">
|
35 |
+
<div class="bg-gray-800 p-6 rounded-lg shadow-lg flex flex-col justify-center">
|
36 |
+
<h1 class="text-2xl text-center font-bold mb-4">Upload File</h1>
|
37 |
+
<input type="file" class="block custom-file-input" id="fileInput">
|
38 |
+
<p id="fileName" class="mt-3"></p>
|
39 |
+
</div>
|
40 |
+
|
41 |
+
<script>
|
42 |
+
const fileInput = document.getElementById('fileInput');
|
43 |
+
const fileName = document.getElementById('fileName');
|
44 |
+
|
45 |
+
fileInput.addEventListener('change', (event) => {
|
46 |
+
const files = event.target.files;
|
47 |
+
if (files.length > 0) {
|
48 |
+
fileName.textContent = `Selected file: ${files[0].name}`;
|
49 |
+
} else {
|
50 |
+
fileName.textContent = '';
|
51 |
+
}
|
52 |
+
});
|
53 |
+
</script>
|
54 |
+
</body>
|
55 |
+
</html>
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
jupyterlab
|