.vscode | ||
app/public | ||
php-extensions | ||
default.conf | ||
docker-compose.yaml | ||
Dockerfile | ||
README.md |
How to use
To use this template for a project you need to open this folder as a workspace in VSCode. After this use the following command in the terminal while you are in the workspace directory:
docker compose up --build -d
There is also a MYSQL database in here which can be safely deleted from the docker-compose.yaml if it is not needed.
Configure NGINX or PHP
If you want or need to configure PHP or NGINX you can edit their respective config files. All PHP configs are nestled under php-extensions and loaded in as config extensions. If you create an already existing config in there it will overwrite the normal config in the container.
The NGINX configuration is the file labeled "default.conf"
Add new extensions to PHP
If you need to add a PDO driver or other extension to your PHP Container you can do so in the Dockerfile by adding a new RUN command for the installation and one for the activation.
You can see examples of that in the file, there is also the possibility of adding a extension from PECL, but this is not supported by examples ATM.
After doing any of this it is recommended to use the command "docker compose down" and start it again as seen above.
How to Debug in VSCODE
Thanks to the included launch.json you just need to start the only run-config there is. All edits and additions to /app/public will immediatly be mirrored in the container via a BIND mount. So there is no need to restart the docker compose command.