Skip to content

Commit

Permalink
update instructions, cache dir for VS Code debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Dec 4, 2024
1 parent d2d856d commit 7c3fb39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,20 @@ development instance in your `.env` file:
USE_DEBUGPY_FOR_DEV=true
```

Next run the install script to install debugpy:

docker compose -f docker-compose.dev.yml run -u root ckan-dev ./install_src.sh

Then start the containers in [development mode](#development-mode) and launch VS Code.

In VS Code:

1. Install the "Dev Container" extension: press CTRL+SHIFT+X, type "dev container", click "install"
2. Click the "Open a Remote Window" button in the bottom-left of the VS Code window
3. Click "Attach to Running Container..." and select your ckan-dev container, e.g. "ckan-docker-ckan-dev-1"
4. Click the "Run and Debug" icon on the left panel then "create a launch.json", select "Python Debugger", "Remote Attach", host "localhost" and port "5678"
5. Press F5 or click the "Run" menu and "Start Debugging"
4. Click the "Run and Debug" icon on the left panel and choose to install the "Python Debugger"
5. Click "create a launch.json", select "Python Debugger", "Remote Attach", host "localhost" and port "5678"
6. Press F5 or click the "Run" menu and "Start Debugging"

You can now set breakpoints and remote debug your CKAN development instance.

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ volumes:
pip_cache:
site_packages:
local_bin:
vscode_server:
home_dir:

services:

Expand All @@ -29,7 +29,7 @@ services:
- pip_cache:/root/.cache/pip
- site_packages:/usr/local/lib/python3.10/site-packages
- local_bin:/usr/local/bin
- vscode_server:/root/.vscode-server
- home_dir:/srv/app/
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"]
Expand Down

0 comments on commit 7c3fb39

Please sign in to comment.