Skip to content

Commit

Permalink
feat: add basic DevContainers setup
Browse files Browse the repository at this point in the history
  • Loading branch information
yesdevnull committed Oct 9, 2023
1 parent c6c4df8 commit 7d39c58
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}
14 changes: 14 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 7d39c58

Please sign in to comment.