LoginSignup
0
0

More than 3 years have passed since last update.

「memo」VscodeでFlaskをremote debugする方法

Posted at

リモート接続の拡張機能の種類

  • SSH
  • Containers (今回はこれを使う)
  • WSL

拡張機能は

  • Remote - Containersをインストールしておきます。

リモート接続設定

  • 「remote-containers: Add Development Container Configuration Files...」を選択
    image.png

  • 「Docker in Docker Compiose debian:9」を選択
    image.png

  • ここまで進めると.devcontainerフォルダーと3つのファイルが生成される

    • .devcontainer
      • devcontainer.json
      • docker-compose.yml
      • Dockerfile

docker compose

  • devcontainer.jsonを編集
    • "ms-azuretools.vscode-docker" ⇒ "ms-python.python"
{
    "name": "Flask Remote Sample",
    "dockerComposeFile": "docker-compose.yml",
    "service": "web_flask",
    "workspaceFolder": "/projects",
    "extensions": [
      "ms-python.python"
    ]
}

動かして見る

  • 「Remote-Containers: Open Folders in Container...」を選択 image.png

参考

VS CodeのRemote DevelopmentでFlaskアプリをデバッグしてみた
Flask Tutorial in Visual Studio Code
microsoft/python-sample-vscode-flask-tutorial

docker.for.mac.localhost

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