Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: 683 create and enable devcontainer #684

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
31 changes: 31 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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]
}
File renamed without changes.
4 changes: 4 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -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"