Complete Isolation
Your development environment runs entirely in containers:
- PHP runtime with all extensions
- Database connections preconfigured
- Development tools (Composer, npm, etc.)
- Debugging tools (Xdebug) ready to use
DAMP provides seamless VS Code DevContainer integration, giving you a complete development environment inside Docker containers. All your development tools—PHP, Node.js, Composer, debugging tools—run inside containers while maintaining the familiar VS Code experience.
DevContainers are a VS Code feature that lets you develop inside Docker containers:
Complete Isolation
Your development environment runs entirely in containers:
VS Code Integration
Seamless VS Code experience:
Zero Setup
New team members get instant environments:
DAMP automatically generates DevContainer configurations for every project:
// .devcontainer/devcontainer.json (auto-generated){ "name": "Php Starter", "workspaceMount": "source=damp_site_php-starter,target=/workspace,type=volume", "workspaceFolder": "/workspace/php-starter", //"image": "mcr.microsoft.com/devcontainers/php:1-8.4", "build": { "dockerfile": "./Dockerfile", "context": ".", "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.4" } }, // Features to add to the dev container. More info: https://containers.dev/features. "features": { "ghcr.io/devcontainers/features/node:1": { "version": "latest" }, // "ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {}, // Add Claude AI feature "ghcr.io/opencodeco/devcontainers/install-php-extensions:0": { "extensions": "bcmath pdo_mysql pcntl mysqli intl zip gd gmagick" } }, // Configure tool-specific properties. "customizations": { // Configure properties specific to VS Code. "vscode": { "settings": {}, "extensions": [ "streetsidesoftware.code-spell-checker" ] } }, "mounts": [ "source=damp_site_php-starter,target=/usr/local/etc/php/conf.d/php.ini,type=volume,volume-subpath=scroll/.devcontainer/php.ini", "source=damp_site_php-starter,target=/usr/local/etc/php/conf.d/z-xdebug.ini,type=volume,volume-subpath=scroll/.devcontainer/xdebug.ini" ], // Specify docker network(s) in devcontainer.json "runArgs": [ "--network=devnet", "--name", "php-starter_devcontainer" ], // Use 'forwardPorts' to make a list of ports inside the container available locally. "forwardPorts": [8080],
// Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html && sudo service apache2 start" // Use 'postStartCommand' to run commands after the container starts. "postStartCommand": "php -S 0.0.0.0:8080" // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // "remoteUser": "root"}
Folder structure:
DAMP automatically configures DevContainers for new projects:
Create DAMP Project
Use DAMP to create a new project.
Open in VS Code
Click “Open in VS Code” from the DAMP project card.
Install DevContainer Extension
VS Code will prompt to install the DevContainer extension if not present.
Reopen in Container
VS Code will ask to “Reopen in Container” - click “Reopen in Container”.
Container Initialization
Wait for container to build and initialize:
DevContainers provide full IntelliSense and code intelligence:
The VS Code terminal connects directly to your development container:
# Terminal runs inside PHP containerroot@container:/php-starter$ php --versionPHP 8.2.10 (cli) (built: Aug 16 2023 15:20:18) (NTS)
# All development tools availableroot@container:/php-starter$ composer installroot@container:/php-starter$ php artisan migrateroot@container:/php-starter$ npm run dev
Seamless file editing with container awareness:
DAMP pre-configures Xdebug for DevContainer debugging:
; Xdebug configuration (automatically configured)xdebug.mode=debugxdebug.start_with_request=yesxdebug.client_host=host.docker.internalxdebug.client_port=9003xdebug.idekey=VSCODE
Launch configuration automatically created:
// .vscode/launch.json (auto-generated){ "version": "0.2.0", "configurations": [ { "name": "Listen for Xdebug", "type": "php", "request": "launch", "port": 9003, "pathMappings": { "/var/www/html": "${workspaceFolder}" } } ]}
Read more about debugging with Xdebug Here: Xdebug Guide.
Add additional development tools:
{ "features": { "ghcr.io/devcontainers/features/git:1": {}, "ghcr.io/devcontainers/features/github-cli:1": {}, "ghcr.io/devcontainers/features/docker-in-docker:1": {}, "ghcr.io/devcontainers/features/aws-cli:1": {} }}
Add recommended extensions for your project:
{ "customizations": { "vscode": { "extensions": [ "bmewburn.vscode-intelephense-client", "xdebug.php-debug", "onecentlin.laravel-blade", "codingyu.laravel-goto-view", "bradlc.vscode-tailwindcss" ] } }}
DAMP optimizes DevContainer performance by using the named volume strategy. This approach enhances speed and efficiency. On Site creation DAMP copy the codebase to the named volume.
Faster container builds:
# Multi-stage builds for efficiencyFROM php:8.2-fpm as baseRUN apt-get update && apt-get install -y \ git unzip curl
FROM base as developmentRUN pecl install xdebug \ && docker-php-ext-enable xdebug
Configure container resources:
{ "runArgs": [ "--memory=4g", "--cpus=2.0" ]}
Symptoms: DevContainer fails to build or start
Solutions:
Ctrl+Shift+P
→ “DevContainers: Rebuild Container”docker system prune -a
Symptoms: Xdebug breakpoints not working
Solutions:
php -m | grep xdebug
DevContainers with DAMP provide the ultimate development experience - all the benefits of containerization with the familiar VS Code interface you love.