FYP_ASR_Service / .devcontainer /devcontainer.json
HK0712's picture
updated building setting (may error)
daa0137
{
"name": "FYP Backend (GPU)",
// 【【【【【 方案 A:快速模式 (當依賴沒變時) 】】】】】
//"image": "my-project-image:latest", // 使用上次成功建置的、帶有標籤的映像
// "build": { ... },
// 【【【【【 方案 B:重建模式 (當依賴改變時) 】】】】】
// "image": "my-project-image:latest",
"build": {
"dockerfile": "../Dockerfile",
"context": ".."
},
// 這是最最最關鍵的部分!
"runArgs": [
"--gpus=all"
],
// 轉發端口,以便您可以訪問 FastAPI
"forwardPorts": [8000],
// 將工作區掛載到容器中
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/FYP-Backend,type=bind,consistency=cached",
"workspaceFolder": "/workspaces/FYP-Backend",
// 讓容器在 VS Code 關閉後保持運行
"shutdownAction": "none",
// 在容器創建後運行的命令 (可選,但推薦)
//"postCreateCommand": "pip install -r requirements.txt",
// VS Code 擴展推薦 (可選)
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
]
}
}
}