On a VPS I ran a dockerized Jupyter Lab that itself driven from project freqtrade. It is the docker-compose and Dockerfile : docker-compose.yml :
---
version: '3'
services:
ft_jupyterlab:
build:
context: .
dockerfile: docker/Dockerfile.jupyter
restart: unless-stopped
container_name: ft_jupyterlab
ports:
- "127.0.0.1:8888:8888"
volumes:
- "./user_data:/freqtrade/user_data"
# Default command used when running `docker compose up`
command: >
jupyter lab --port=8888 --ip 0.0.0.0 --allow-root --NotebookApp.token=''
Dockerfile.jupyter :
FROM freqtradeorg/freqtrade:develop_plot
# Pin prompt-toolkit to avoid questionary version conflict
RUN pip install jupyterlab "prompt-toolkit<=3.0.36" jupyter-client --user --no-cache-dir
# Empty the ENTRYPOINT to allow all commands
ENTRYPOINT []
I want to access the Jupyter Lab from the internet via browser. So, I used Nginx as below:
server {
listen 7000;
server_name _;
location / {
proxy_pass http://localhost:8888;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Suppose that test.example.com
is pointed to <vps_ip> . By navigating to http://test.example.com:7000
from another machine, just the title of “JupyterLab” shown. No any contents rendered in browser.
Also it is log:
[I 2024-02-06 06:18:07.626 ServerApp] 302 GET / (@172.27.0.1) 0.63ms