From aaa4382ff2c5105bc362777f62156b8383b67ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=9C=E4=BA=91?= Date: Mon, 3 Mar 2025 09:32:35 +0000 Subject: [PATCH] =?UTF-8?q?build(devcontainer):=20=E6=B7=BB=E5=8A=A0=20Hyp?= =?UTF-8?q?erf=20=E5=BC=80=E5=8F=91=E5=A5=97=E4=BB=B6=E6=A0=B8=E5=BF=83?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 devcontainer.json 配置文件,用于 Hyperf 框架的开发环境 - 配置了基础设置、挂载点、容器生命周期管理等 - 集成了多个 Visual Studio Code 扩展,提升开发效率 --- .devcontainer/devcontainer.json | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..e1a0d2b --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,49 @@ +{ + "name": "Hyperf Development Kit Core Dev Container", + "image": "harbor.luxcreo.cn/library/hyperf:8.1-swoole", + // 基础配置 + "workspaceFolder": "/srv/www", // 对应 --workdir + "workspaceMount": "source=${localWorkspaceFolder},target=/srv/www,type=bind", // 主工作区挂载 + // 附加挂载 + "mounts": [ + "source=${env:HOME}/.ssh,target=/root/.ssh,type=bind", // SSH 密钥挂载 + "source=${env:HOME}/.gitconfig,target=/root/.gitconfig,type=bind" // SSH 密钥挂载 + ], + // 容器生命周期 + "shutdownAction": "stopContainer", // 类似 --rm 的清理行为 + "updateRemoteUserUID": true, // 确保用户 ID 同步 + // 保留的必要 runArgs + "runArgs": [ + "--pull=always", // 强制拉取最新镜像 + "--name=hdk-core" // 容器命名(需保持唯一性) + ], + // 初始化命令 + "postCreateCommand": "echo 'Container initialized!'", + "customizations": { + "vscode": { + "extensions": [ + "rid9.datetime", + "MS-CEINTL.vscode-language-pack-zh-hans", + "ms-azuretools.vscode-docker", + "janisdd.vscode-edit-csv", + "onecentlin.laravel-blade", + "DavidWang.ini-for-vscode", + "bmewburn.vscode-intelephense-client", + "mechatroner.rainbow-csv", + "Alibaba-Cloud.tongyi-lingma", + "atommaterial.a-file-icon-vscode", + "ParthR2031.colorful-comments", + "vincaslt.highlight-matching-tag", + "xabikos.JavaScriptSnippets", + "shufo.vscode-blade-formatter", + "dansysanalyst.pest-snippets", + "m1guelpf.better-pest", + "xoronic.pestfile", + "xdebug.php-debug", + "golang.go", + "cweijan.vscode-typora", + "ciceroisback.loam" + ] + } + } +} \ No newline at end of file