Skip to content

Commit 9969c9a

Browse files
committed
Update Nginx environment variable handling in docker-compose.yml
This commit improves how environment variables are managed for the Nginx service: - Add APP_DIR variable to the web service environment variables - Derive APP_PUBLIC_DIR dynamically from APP_DIR - Maintain backward compatibility with existing template files - Ensure consistent directory referencing throughout the stack This change simplifies configuration by reducing the number of variables that need to be manually synchronized, making it easier for users to switch between different PHP frameworks or customize their application directory structure.
1 parent c0356a9 commit 9969c9a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ services:
4444
environment:
4545
- NGINX_HOST=${NGINX_HOST}
4646
- APP_WORKSPACE=${APP_WORKSPACE:-default}
47-
- APP_PUBLIC_DIR=${APP_PUBLIC_DIR:-public}
47+
- APP_DIR=${APP_DIR:-app}
48+
- APP_PUBLIC_DIR=${APP_DIR:-app}/public
4849
- NGINX_WORKSPACE_DIR=${NGINX_WORKSPACE_DIR:-workspace}
4950
command: /bin/sh -c "envsubst '$$NGINX_HOST $$APP_WORKSPACE $$APP_PUBLIC_DIR $$NGINX_WORKSPACE_DIR' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
5051
restart: always

0 commit comments

Comments
 (0)