Support the use of dev containers for reproducible dev environment #1120
-
This would allow having the dev environment automatically set up and allow using code spaces. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
if #721 is solved it may also support devcontainers |
Beta Was this translation helpful? Give feedback.
-
Thanks for the interest! This would mean a somewhat tightly coupling with the specific product GitHub Code Spaces. I think it could work for other types of projects that don't involve so much of handling different containers that the developer is expected to manage (e.g. the DB), so for now I would leave it as it is. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/loft-sh/devpod is an open source solution using devcontainer.json specification. No vendor lock-in. |
Beta Was this translation helpful? Give feedback.
-
Prerequisites and Setup InstructionsI have successfully built a backend development container in VS Code. Before using it, make sure you have already built the Once these steps are complete, you can open the backend folder in VS Code and place the following configuration file at: {
"name": "Existing Dockerfile",
"build": {
"context": "..",
"dockerfile": "../Dockerfile"
},
"features": {
"ghcr.io/va-h/devcontainers-features/uv:1": {
"version": "latest"
}
},
// 使用父容器中 Docker Compose 的网络
"runArgs": [
"--network=full-stack-fastapi-template_default"
],
// 自动安装 VS Code Python 插件
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
],
// 配置 Python 解释器自动使用虚拟环境
"settings": {
"python.defaultInterpreterPath": "/workspaces/backend/.venv/bin/python"
}
}
},
// 在容器创建后自动运行 uv sync
"postCreateCommand": "uv sync"
} |
Beta Was this translation helpful? Give feedback.
Thanks for the interest! This would mean a somewhat tightly coupling with the specific product GitHub Code Spaces.
I think it could work for other types of projects that don't involve so much of handling different containers that the developer is expected to manage (e.g. the DB), so for now I would leave it as it is.