configurable php version, root_path, fix db host

This commit is contained in:
Mayel 2021-07-14 23:57:43 +02:00
parent 32d2f3f04f
commit 2e7a8c66f1
5 changed files with 16 additions and 8 deletions

View File

@ -5,8 +5,13 @@ DOMAIN=example.com
#EXTRA_DOMAINS=', `www.example.com`'
LETS_ENCRYPT_ENV=production
## Extensions you do NOT need, out of this list of installed extensions: https://github.com/adhocore/docker-phpfpm#php80
#PHP_EXTENSIONS_TO_DISABLE="calendar"
ROOT_PATH=/var/www/html
PHP_VERSION=7.4
# environment for PHP frameworks like laravel/symphony
APP_ENV=prod
## Extra extensions you need
#PHP_EXTENSIONS="calendar"
# Optional database
#COMPOSE_FILE="compose.yml:compose.mariadb.yml"

View File

@ -1,4 +1,5 @@
export NGINX_DEFAULT_CONF_VERSION=v6
# export PHP_VERSION=7.4
export NGINX_DEFAULT_CONF_VERSION=v7
export PHP_UPLOADS_CONF_VERSION=v3
export ENTRYPOINT_CONF_VERSION=v2
export ENTRYPOINT_MAILRELAY_CONF_VERSION=v1

View File

@ -2,7 +2,7 @@ version: "3.8"
services:
app:
environment:
- DB_HOST=db
- DB_HOST=${STACK_NAME}_db
- DB_USER=site
- DB_PASSWORD_FILE=/run/secrets/db_password
- DB_NAME=site

View File

@ -1,13 +1,14 @@
version: "3.8"
services:
app:
image: php:8.0-fpm-alpine3.13
image: php:${PHP_VERSION}-fpm-alpine3.13
volumes:
- "site_content:/var/www/html/"
networks:
- internal
environment:
- PHP_EXTENSIONS_TO_DISABLE
- PHP_EXTENSIONS
- APP_ENV
configs:
- source: php_uploads_conf
target: /usr/local/etc/php/conf.d/uploads.ini
@ -20,7 +21,7 @@ services:
failure_action: rollback
order: start-first
labels:
- coop-cloud.${STACK_NAME}.app.version=8.0-92fac7ac
- coop-cloud.${STACK_NAME}.app.version=${PHP_VERSION}-92fac7ac
frontend:
image: nginx:1.19.2
networks:
@ -49,6 +50,7 @@ services:
target: /etc/nginx/conf.d/default.conf
environment:
- STACK_NAME
- ROOT_PATH
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost"]
# interval: 30s

View File

@ -4,7 +4,7 @@ server {
listen [::]:80;
server_name localhost;
root /var/www/html;
root {{ env "ROOT_PATH" }};
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;