diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..8c92314 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -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" + ] +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..40dbef6 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -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" diff --git a/.dockerignore b/.dockerignore index ef42962..4b67e1f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,3 +6,5 @@ **/docker-compose.yml **/Procfile **/Vagrantfile +**/.devcontainer +**/.vscode diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..6f93ded --- /dev/null +++ b/.vscode/launch.json @@ -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/" + } + ] + } diff --git a/README.md b/README.md index 4a47e33..f9c2feb 100644 --- a/README.md +++ b/README.md @@ -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`.