Develop PHP applications with MariaDB (MySQL Compatible).
| Options Id | Description | Type | Default Value |
|---|---|---|---|
| imageVariant | PHP version (use -bullseye variants on local arm64/Apple Silicon): | string | 8-bullseye |
| nodeVersion | Node.js version: | string | lts/* |
You can add other services to your docker-compose.yml file as described in Docker's documentation. However, if you want anything running in this service to be available in the container on localhost, or want to forward the service locally, be sure to add this line to the service config:
# Runs the service on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:dbThis dev container includes Apache in addition to the PHP CLI. While you can use PHP's built in CLI (e.g. php -S 0.0.0.0:8080), you can start Apache by running:
apache2ctl startApache will be available on port 8080.
If you want to wire in something directly from your source code into the www folder, you can add a symlink as follows to postCreateCommand:
"postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html"...or execute this from a terminal window once the container is up:
sudo chmod a+x "$(pwd)" && sudo rm -rf /var/www/html && sudo ln -s "$(pwd)" /var/www/htmlNote: This file was auto-generated from the devcontainer-template.json. Add additional notes to a NOTES.md.