0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【備忘録】docker環境にサーバーを立てる時のIP指定注意

Posted at

はじめに

dockerでサーバーを立てるときにIPアドレスの指定でハマってしまったので備忘録として残します

#docker内でサーバーを立てる時のIPアドレスは「0.0.0.0」にする
以下のようにdocker内では、0.0.0.0を指定しておけば、ホスト環境の「127.0.0.1:繋ぎ込みしたポート番号」からアクセスできるようになる

djangoの場合

サーバー起動時のコマンド
$python manage.py runserver 0:8000
# 0 = 0.0.0.0を表す

jupyter-labの場合

/root/.jupyter/jupyter_notebook_config.py
c.NotebookApp.allow_root = True
c.NotebookApp.ip = "0.0.0.0"
c.NotebookApp.token = "xxxx"
c.NotebookApp.port = 8888
c.NotebookApp.open_browser = False
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?