Skip to content

Commit

Permalink
Add php-apache template
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Kionga-Kamau committed Sep 10, 2024
1 parent 7126521 commit c592808
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
14 changes: 14 additions & 0 deletions templates/php-apache/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# PHP-Apache on Debian Linux

## Description

The [Official PHP/Apache](https://hub.docker.com/_/php) image with optional version, extensions, bind mount, and port configuration.

### Notes

None so far


### To-do

- Add Options for Composer, xdebug, DNS and Mail?
7 changes: 5 additions & 2 deletions templates/php-apache/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ services:
- ${PHP_WEB_ROOT:-./app}:/var/www/html
command: >
/bin/bash -c "
if [ -n $${PHP_EXTENSIONS+x} ]; then
docker-php-ext-install $$PHP_EXTENSIONS || exit 1;
if [ -n \"${PHP_EXTENSIONS+x}\" ]; then
docker-php-ext-install $$PHP_EXTENSIONS || {
echo 'Error installing PHP extensions via docker-php-ext-install - check your docker-compose.yml command: section';
exit 1;
}
fi &&
if ! grep -q 'ServerName' /etc/apache2/apache2.conf; then
echo 'ServerName $$APACHE_SERVER_NAME' >> /etc/apache2/apache2.conf;
Expand Down

0 comments on commit c592808

Please sign in to comment.