Add VSCode dev container configuration (#24)

pull/44/head
Jake Howard 2022-03-29 13:49:17 +01:00 zatwierdzone przez GitHub
rodzic 865cd10515
commit a19af88852
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
5 zmienionych plików z 47 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,20 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.163.1/containers/docker-existing-docker-compose
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
{
"name": "Existing Docker Compose (Extend)",
"dockerComposeFile": [
"../docker-compose.yml",
"docker-compose.yml"
],
"service": "web",
"workspaceFolder": "/code",
"settings": {
"terminal.integrated.shell.linux": "bash",
"python.pythonPath": "/usr/local/bin/python"
},
"extensions": [
"ms-python.python",
"editorconfig.editorconfig"
]
}

Wyświetl plik

@ -0,0 +1,7 @@
services:
web:
volumes:
- ./.vscode:/code/.vscode:delegated,rw
# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"

Wyświetl plik

@ -6,3 +6,5 @@
**/docker-compose.yml
**/Procfile
**/Vagrantfile
**/.devcontainer
**/.vscode

16
.vscode/launch.json vendored 100644
Wyświetl plik

@ -0,0 +1,16 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/bakerydemo/manage.py",
"args": ["runserver", "0.0.0.0:8000"],
"django": true,
"justMyCode": false,
"cwd": "${workspaceFolder}/bakerydemo/"
}
]
}

Wyświetl plik

@ -67,6 +67,8 @@ If you're running this on Linux you might get into some privilege issues that ca
CURRENT_UID=$(id -u):$(id -g) docker-compose -f docker-compose.yml -f docker-compose.linux.yml up
```
Alternatively, if you're using VSCode and have the "Remote - Containers" extension, you can open the command palette and select "Remote Containers - Reopen in Container" to attach VSCode to the container. This allows for much deeper debugging.
- Visit your site at http://localhost:8000
- The admin interface is at http://localhost:8000/admin/ - log in with `admin` / `changeme`.