Skip to content

Add VS Code Dev Container configuration - #209

Open
mandarl wants to merge 4 commits into
masterfrom
feature/add-devcontainer
Open

Add VS Code Dev Container configuration#209
mandarl wants to merge 4 commits into
masterfrom
feature/add-devcontainer

Conversation

@mandarl

@mandarl mandarl commented Feb 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds comprehensive VS Code Dev Container configuration for one-click development environment setup
  • Integrates seamlessly with existing Docker Compose infrastructure
  • Pre-configures Xdebug, PHP extensions, and development tools
  • Includes detailed documentation for setup and usage

Problem

Setting up a local development environment for this CakePHP application currently requires:

  • Manual installation of Docker
  • Understanding docker-compose commands
  • Manual setup of VS Code extensions
  • Xdebug configuration
  • Understanding of all the different services and ports

This can be time-consuming and error-prone for new developers.

Solution

Implemented a VS Code Dev Container that:

  • One-click setup: Open in VS Code, click "Reopen in Container", and everything is ready
  • Pre-configured environment: PHP 7.4, Apache, MariaDB, OpenLDAP, Keycloak, MailHog all configured
  • Built-in debugging: Xdebug 3.1.6 pre-configured and ready to use with F5
  • Useful extensions: Automatically installs Intelephense, PHP Debug, Twig support, GitLens, etc.
  • Port forwarding: All development services automatically forwarded and labeled
  • Comprehensive docs: Detailed README with setup, usage, and troubleshooting

Changes

New Files

  • .devcontainer/devcontainer.json - Main Dev Container configuration
    • VS Code settings and extensions
    • Port forwarding configuration
    • Service integration
  • .devcontainer/docker-compose.devcontainer.yml - Dev Container overrides
    • Keeps container running for interactive development
    • Xdebug environment configuration
  • .devcontainer/README.md - Comprehensive documentation
    • Getting started guide
    • Feature list
    • Development workflow
    • Troubleshooting section

Updated Files

  • README.md - Added Dev Container as recommended option
  • CLAUDE.md - Updated development commands section

Features

Automatically Installed Extensions

  • Intelephense (PHP IntelliSense)
  • PHP Debug (Xdebug integration)
  • PHP Namespace Resolver
  • PHP DocBlocker
  • Twig language support
  • GitLens
  • EditorConfig
  • Docker extension

Pre-configured Services

All services from docker-compose.yml are available:

Debugging Ready

  • Xdebug 3.1.6 configured and enabled
  • Path mappings pre-configured
  • Just press F5 to start debugging

Test Plan

  • Open project in VS Code with Dev Containers extension installed
  • Click "Reopen in Container" when prompted
  • Wait for container to build and start
  • Verify application is accessible at http://localhost:8000
  • Verify all services are running (MailHog, phpMyAdmin, phpLDAPadmin)
  • Test Xdebug: Set a breakpoint and press F5
  • Verify PHP extensions are installed in VS Code
  • Run composer test in the integrated terminal
  • Verify database migrations work: bin/cake migrations migrate

Benefits

  • Faster onboarding: New developers can start coding in minutes instead of hours
  • Consistency: Everyone uses the same development environment
  • Better DX: Integrated debugging, IntelliSense, and linting out of the box
  • No conflicts: Environment is isolated in container
  • Easier maintenance: Update configuration in one place instead of documentation

Backward Compatibility

This change is fully backward compatible. Developers can still use:

  • Manual docker compose up workflow
  • Any other IDE or editor
  • Direct Docker commands

The Dev Container is an optional enhancement, not a requirement.

🤖 Generated with Claude Code

mandarl and others added 4 commits February 4, 2026 08:52
Added CLAUDE.md with comprehensive development guide including:
- Docker development commands and setup
- Testing and code quality commands
- Database migration workflows
- CakePHP 3 architecture overview
- Authentication system details
- Common pitfalls and solutions

Added agents.md as a simple reference pointer to CLAUDE.md.
Updated .gitignore to exclude .claude/ directory.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Check if files exist before calling filesize() in both the JSON feed
and RSS/Atom feed methods to prevent errors when referenced files
are missing from the filesystem.

- Added file_exists() check in eventsJson() method (line 297)
- Added file_exists() check in feed() method (line 491)
- Skip missing files gracefully instead of throwing errors

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
When duplicating an event, check if the source file exists on the
filesystem before copying its metadata to the new event. This prevents
creating orphaned database records that reference non-existent files.

- Added file_exists() check in _afterAdd() method around line 1728
- Skip missing files gracefully instead of creating invalid file records
- Follows the same pattern as the RSS feed file existence checks

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add comprehensive Dev Container setup for improved developer experience
with VS Code. This provides a one-click development environment with
all dependencies, extensions, and debugging pre-configured.

Features:
- Integrates with existing docker-compose.yml
- Pre-configured Xdebug for debugging
- Useful PHP/CakePHP VS Code extensions automatically installed
- Port forwarding for all development services
- Comprehensive documentation

Changes:
- Added .devcontainer/devcontainer.json with VS Code settings
- Added .devcontainer/docker-compose.devcontainer.yml for overrides
- Added .devcontainer/README.md with setup and usage instructions
- Updated README.md to include Dev Container as recommended option
- Updated CLAUDE.md to document Dev Container workflow

Benefits:
- Faster onboarding for new developers
- Consistent development environment across team
- No manual setup of PHP, Xdebug, or extensions needed
- Integrated debugging experience in VS Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@denzuko

denzuko commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

This sound more like a local environment config than one specific to deployment. Could this be redone to account for production instead of local dev?

@mandarl

mandarl commented Feb 24, 2026

Copy link
Copy Markdown
Member Author

@denzuko - this change is specific to development environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants