Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instructions to run on docker with a custom password ( no token ) #1

Open
Jarrodsz opened this issue Mar 29, 2023 · 3 comments
Open

Comments

@Jarrodsz
Copy link

Jarrodsz commented Mar 29, 2023

**note: below example assumes your docker-compose and other files are in the root of /ft_userdata instead of a docker subfolder ( which i have seen in some repros ). you can modify this with the context property in the dockerfile if needed ./docker **

In docker-compose I added this section:

  lab:
    build:
      context: .
      dockerfile: Dockerfile.jupyter
    restart: unless-stopped
    container_name: lab
    ports:
      - "127.0.0.1:8888:8888"
      volumes:
      - "./user_data:/freqtrade/user_data"
      - "./jupyter_config.py:/root/.jupyter/jupyter_notebook_config.py"
      - "./notebook_helper.py:/freqtrade/notebook_helper.py"
      - "./RollingBacktestNotebook.ipynb:/freqtrade/RollingBacktestNotebook.ipynb"
    command: >
      jupyter lab --port=8888 --ip 0.0.0.0 --allow-root --NotebookApp.token=''

jupyter_config.py:

c.NotebookApp.token = ''
c.NotebookApp.password_required = True
c.NotebookApp.password = '<password_token_here>'

Dockerfile.jupyter:

FROM freqtradeorg/freqtrade:develop_plot


# Pin jupyter-client to avoid tornado version conflict
RUN pip install jupyterlab jupyter-client==7.3.4 --user --no-cache-dir

# Requirements for freqtrade
RUN pip install tqdm quantstats

# Empty the ENTRYPOINT to allow all commands
ENTRYPOINT []

To get the password token run:

docker-compose run --rm lab python -c 'from notebook.auth import passwd; print(passwd())'
@froggleston
Copy link
Owner

I believe you don't need the jupyter_config if you don't want to password protect the instance (i.e. if you're running on your local machine, I doubt you'd need to provide this).

@Jarrodsz
Copy link
Author

Jarrodsz commented May 4, 2023

I believe you don't need the jupyter_config if you don't want to password protect the instance (i.e. if you're running on your local machine, I doubt you'd need to provide this).

It asks for a token else
I think this is the only way to bypass auth totally did not found another way, perhaps there is?

@froggleston
Copy link
Owner

Ah OK - maybe it's a docker-related thing. I run my jupyter instance with jupyter notebook --port ${port} --ip 0.0.0.0 --no-browser --NotebookApp.allow_origin='*' and I don't have to set any auth options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants