Skip to content

feat: Add VS Code DevContainer for simplified development setup#10085

Open
JohnRDOrazio wants to merge 5 commits intoroundcube:masterfrom
JohnRDOrazio:feature/devcontainer
Open

feat: Add VS Code DevContainer for simplified development setup#10085
JohnRDOrazio wants to merge 5 commits intoroundcube:masterfrom
JohnRDOrazio:feature/devcontainer

Conversation

@JohnRDOrazio
Copy link
Contributor

@JohnRDOrazio JohnRDOrazio commented Feb 5, 2026

Summary

  • Add complete VS Code DevContainer configuration for one-click development environment setup
  • Includes PHP 8.4, MariaDB, Dovecot IMAP, and Mailhog services
  • Automatic database initialization, dependency installation, and configuration
  • Pre-configured VS Code tasks for testing, linting, and development server
  • Fix php-cs-fixer to exclude actual shell scripts while keeping PHP CLI scripts with .sh extension
  • Add PHPUnit result cache to .gitignore

Closes #10084

Test plan

  • Open repository in VS Code with Dev Containers extension installed
  • Click "Reopen in Container" when prompted
  • Verify all services start (MariaDB, Dovecot, Mailhog)
  • Verify database is automatically initialized
  • Start dev server with Ctrl+Shift+B and verify Roundcube loads
  • Login with testuser/testpass credentials
  • Run PHPUnit tests via VS Code task
  • Run php-cs-fixer and verify it doesn't fail on shell scripts

🤖 Generated with Claude Code

JohnRDOrazio and others added 5 commits February 4, 2026 01:15
This commit introduces a comprehensive VSCode DevContainer setup to streamline
the development environment for Roundcube. This setup provides:

- Automated provisioning of all necessary services (PHP, MariaDB, IMAP, MailHog).
- Pre-configured VSCode extensions for PHP and JavaScript development.
- Automated installation of PHP and JavaScript dependencies.
- Automated database initialization and Roundcube configuration.

As part of simplifying the development setup, a fix for static file serving
with the PHP built-in server is also included. This ensures better compatibility
when using the built-in server for local development, without affecting
production environments (Apache/Nginx).
DevContainer:
- Add PHP memory_limit=512M for PHPStan compatibility
- Fix Dockerfile.dovecot entrypoint script (use printf for newlines)
- Fix post-create.sh: validate table_count, add DROP error handling,
  correct des_key length to 24 chars, fix comment style
- Remove unnecessary exposed SMTP port from docker-compose.yml

Static file server (public_html/static.php):
- Fix HTTP Range suffix handling (bytes=-500 now returns last 500 bytes)
- Add fopen error handling to prevent operations on failed file handles
- Add fread error handling to prevent infinite loops
- Fix PHP-CS-Fixer style issues

Other:
- Add /temp to .eslintrc.js ignorePatterns (third-party JS libs)
- Add AI coding agents and build artifacts to .gitignore

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The *.sh pattern was intended to lint PHP CLI scripts in bin/ that use
the .sh extension, but it also caught actual bash scripts which caused
linter failures. Exclude .ci/, .devcontainer/, and the four real shell
scripts in bin/ (cssshrink.sh, jsshrink.sh, makedoc.sh, transifexpull.sh).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Normalize composer.json with composer normalize
- Add tests/.phpunit.result.cache to .gitignore

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The kolab/net_ldap3 package is already listed under "suggest" in
composer.json, so it shouldn't also be in require-dev. Instead, add
a VS Code task "Install Suggested Packages" that installs both
suggested packages (zxcvbn-php and net_ldap3) on demand.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@JohnRDOrazio
Copy link
Contributor Author

I had to make some adjustments to static.php in order for it to work with the PHP built-in server, which proves useful for a dev environment without having to set up an apache or nginx server.

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.

Add VS Code DevContainer for simplified development setup

1 participant