diff --git a/.config/Dockerfile b/.devcontainer/Dockerfile similarity index 100% rename from .config/Dockerfile rename to .devcontainer/Dockerfile diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..1ebbbfa89 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +{ + "name": "ra2ce_dev_container", + "build": { + "dockerfile": "Dockerfile" + }, + "mounts": [ + "source=${localWorkspaceFolder},target=/usr/src/app,type=bind,consistency=cached", + "source=ra2ce_docker_env,target=/usr/src/.env,type=volume" + ], + // `git config --global core.autocrlf true` prevents git from showing differences on ALL files when running + // in the ra2ce (linux) container + // `git config --global --add safe.directory ${containerWorkspaceFolder}` allows git to sync with the devcontainer. + "postStartCommand": "poetry install & git config --global core.autocrlf true & git config --global --add safe.directory ${containerWorkspaceFolder}", + // postCreateCommand.sh does not seem to work due to line endings. + // "postStartCommand": "bash .devcontainer/postCreateCommand.sh", + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance", + "ms-python.debugpy", + "ms-python.black-formatter", + "ms-python.isort", + "ms-python.pylint", + "ms-vscode.test-adapter-converter", + "njpwerner.autodocstring" + ] + } + }, + "forwardPorts": [3000] + } \ No newline at end of file diff --git a/.config/environment.yml b/.devcontainer/environment.yml similarity index 100% rename from .config/environment.yml rename to .devcontainer/environment.yml diff --git a/.config/jupyter/jupyter_server_config.json b/.devcontainer/jupyter/jupyter_server_config.json similarity index 100% rename from .config/jupyter/jupyter_server_config.json rename to .devcontainer/jupyter/jupyter_server_config.json diff --git a/.config/jupyter/jupyter_server_config.py b/.devcontainer/jupyter/jupyter_server_config.py similarity index 100% rename from .config/jupyter/jupyter_server_config.py rename to .devcontainer/jupyter/jupyter_server_config.py diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh new file mode 100644 index 000000000..623638166 --- /dev/null +++ b/.devcontainer/postCreateCommand.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +poetry install +git config --global core.autocrlf true +git config --global --add safe.directory "/usr/src/app" \ No newline at end of file