diff --git a/.env.sample b/.env.sample index f491bb6..90fb0e3 100644 --- a/.env.sample +++ b/.env.sample @@ -7,7 +7,7 @@ LETS_ENCRYPT_ENV=production ROOT_PATH=/var/www/html PHP_VERSION=7.4 -# environment for PHP frameworks like laravel/symphony +# environment (needed for PHP frameworks like laravel/symphony) APP_ENV=prod ## Extra extensions you need (run `abra app YOURAPPDOMAIN run app "php -m"` to see active extensions) diff --git a/README.md b/README.md index 4bef6fa..5ea93b0 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ Coöp Cloud + [PHP](https://php.org) + MariaDB (optional) + Nginx = 🥳 ## Extra +Indicate extensions you need in the `PHP_EXTENSIONS` env var. The entrypoint script will install them on startup. + You can see what PHP extensions compiled into the image by checking the output of `abra app YOURAPPDOMAIN run app "php -m"` You can see the PHP config and environment by checking the output of `abra app YOURAPPDOMAIN run app "php -i"` diff --git a/abra.sh b/abra.sh index 45d2dec..7763e93 100644 --- a/abra.sh +++ b/abra.sh @@ -1,7 +1,7 @@ # export PHP_VERSION=7.4 export NGINX_DEFAULT_CONF_VERSION=v7 -export PHP_UPLOADS_CONF_VERSION=v3 -export ENTRYPOINT_CONF_VERSION=v3 +export PHP_UPLOADS_CONF_VERSION=v4 +export ENTRYPOINT_CONF_VERSION=v1 export ENTRYPOINT_MAILRELAY_CONF_VERSION=v1 export MSMTP_CONF_VERSION=v3 diff --git a/compose.mariadb.yml b/compose.mariadb.yml index dd9eb23..b38f53a 100644 --- a/compose.mariadb.yml +++ b/compose.mariadb.yml @@ -16,7 +16,7 @@ services: volumes: - "mariadb:/var/lib/mysql" networks: - - internal + - backend environment: - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password - MYSQL_DATABASE=site diff --git a/compose.yml b/compose.yml index 839bbdc..ab788df 100644 --- a/compose.yml +++ b/compose.yml @@ -5,7 +5,8 @@ services: volumes: - "site_content:/var/www/html/" networks: - - internal + - backend + - proxy environment: - PHP_EXTENSIONS - APP_ENV @@ -23,9 +24,8 @@ services: labels: - coop-cloud.${STACK_NAME}.app.version=${PHP_VERSION}-92fac7ac frontend: - image: nginx:1.19.2 + image: nginx:1.20-alpine networks: - - internal - proxy depends_on: - app @@ -42,7 +42,7 @@ services: - "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect" - "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true" - "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}" - - coop-cloud.${STACK_NAME}.frontend.version=1.19.2-c628b67d + - coop-cloud.${STACK_NAME}.frontend.version=1.20-c628b67d volumes: - site_content:/var/www/html/ configs: @@ -58,8 +58,8 @@ services: # retries: 10 # start_period: 1m networks: - internal: - internal: true + backend: + # internal: true proxy: external: true volumes: diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index 6f4ab1a..b1ef2ac 100644 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -1,11 +1,10 @@ -#!/bin/bash +#!/bin/sh {{ if (env "PHP_EXTENSIONS") }} -echo Installing PHP extensions {{ env "PHP_EXTENSIONS" }} +echo Installing PHP extensions: {{ env "PHP_EXTENSIONS" }} docker-php-ext-install {{ env "PHP_EXTENSIONS" }} {{ end }} -if [ -n "$@" ]; then - "$@" -fi +exec "$@" +php-fpm \ No newline at end of file diff --git a/uploads.ini b/uploads.ini index a60fde7..532057b 100644 --- a/uploads.ini +++ b/uploads.ini @@ -1,3 +1,5 @@ file_uploads = On upload_max_filesize = 256M post_max_size = 256M +log_errors = On +error_log = /dev/stderr \ No newline at end of file