From d2a997f8694b00c7613218a067caabb68b624cda Mon Sep 17 00:00:00 2001 From: Dan Barrett Date: Mon, 9 Oct 2023 14:25:43 +1100 Subject: [PATCH] feat: add basic DevContainers setup --- .devcontainer/Dockerfile | 7 ++++++ .devcontainer/devcontainer.json | 39 ++++++++++++++++++++++++++++++++ .devcontainer/docker-compose.yml | 14 ++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/docker-compose.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..e1c39b4 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,7 @@ +FROM php:8.2-cli + +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ + +RUN chmod +x /usr/local/bin/install-php-extensions && \ + install-php-extensions ldap xdebug && \ + install-php-extensions @composer \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..4d5ab7a --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,39 @@ +{ + // https://code.visualstudio.com/docs/devcontainers/containers + "name": "iter8 LDAPRecord Bundle", + "dockerComposeFile": [ + "../docker-compose.yml", + "docker-compose.yml" + ], + "service": "php", + "workspaceFolder": "/workspace", + "features": { + // https://github.com/devcontainers/features/tree/main/src/common-utils + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": false, + "installOhMyZsh": false, + "installOhMyZshConfig": false, + "username": "vscode", + "userUid": "1000", + "userGid": "1000", + "upgradePackages": "true" + } + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/devcontainers/features/common-utils" + ], + "customizations": { + "vscode": { + "settings": { + "php.validate.executablePath": "/usr/local/bin/php", + "terminal.integrated.defaultProfile.linux": "bash" + }, + "extensions": [ + "xdebug.php-debug" + ] + } + }, + "postCreateCommand": "composer update", + "remoteUser": "vscode", + "shutdownAction": "stopCompose" +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..81779f5 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,14 @@ +version: "3.8" + +services: + php: + build: + context: . + dockerfile: .devcontainer/Dockerfile + + volumes: + - .:/workspace:cached + + network_mode: service:ldap + + command: /bin/sh -c "while sleep 1000; do :; done" \ No newline at end of file