From fa228b046741e73bec5935b24b8bf600d802f389 Mon Sep 17 00:00:00 2001 From: Andrew McIntosh Date: Mon, 5 Jun 2023 07:11:19 -0400 Subject: [PATCH] Update dev container config --- .devcontainer/Dockerfile | 16 ---------- .devcontainer/devcontainer.json | 55 +++++++++++++++------------------ 2 files changed, 25 insertions(+), 46 deletions(-) delete mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index a266802..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.224.2/containers/php/.devcontainer/base.Dockerfile - -# [Choice] PHP version (use -bullseye variants on local arm64/Apple Silicon): 8, 8.1, 8.0, 7, 7.4, 7.3, 8-bullseye, 8.1-bullseye, 8.0-bullseye, 7-bullseye, 7.4-bullseye, 7.3-bullseye, 8-buster, 8.1-buster, 8.0-buster, 7-buster, 7.4-buster -ARG VARIANT="8.1-apache-bullseye" -FROM mcr.microsoft.com/vscode/devcontainers/php:0-${VARIANT} - -# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 -ARG NODE_VERSION="none" -RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi - -# [Optional] Uncomment this section to install additional OS packages. -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install --no-install-recommends vim - -# [Optional] Uncomment this line to install global node packages. -RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g gitmoji-cli" 2>&1 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b810619..dad26e6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,40 +1,35 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.224.2/containers/php +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/php { "name": "PHP", - "build": { - "dockerfile": "Dockerfile", - "args": { - // Update VARIANT to pick a PHP version: 8, 8.1, 8.0, 7, 7.4 - // Append -bullseye or -buster to pin to an OS version. - // Use -bullseye variants on local on arm64/Apple Silicon. - "VARIANT": "8", - "NODE_VERSION": "lts/*" - } - }, + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/php:0-8.2", - // Set *default* container specific settings.json values on container create. - "settings": { - "php.validate.executablePath": "/usr/local/bin/php" - }, + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "xdebug.php-debug", - "bmewburn.vscode-intelephense-client", - "mrmlnc.vscode-apache" - ], + // Configure tool-specific properties. + // "customizations": {}, // Use 'forwardPorts' to make a list of ports inside the container available locally. - "forwardPorts": [8080], + "forwardPorts": [ + 8080 + ], + "features": { + "ghcr.io/devcontainers/features/github-cli:1": { + "installDirectlyFromGitHubRelease": true, + "version": "latest" + }, + "ghcr.io/devcontainers/features/node:1": { + "nodeGypDependencies": true, + "version": "lts" + }, + "ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {} + } // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "composer install", + // "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html" - // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode", - "features": { - "git": "os-provided", - "github-cli": "latest" - } + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" }