serversideup / docker-php

🐳 Production-ready Docker images for PHP. Optimized for Laravel, WordPress, and more!
https://serversideup.net/open-source/docker-php/
GNU General Public License v3.0
1.67k stars 109 forks source link

NGINX_WEBROOT not as documented #308

Closed tomchkk closed 4 months ago

tomchkk commented 5 months ago

Affected Docker Images

serversideup/php:beta-8.2-fpm-nginx-alpine

Docker Labels of the affected images

No response

Current Behavior

In the environment variable specification, the default value of NGINX_WEBROOT is given as: "$APP_BASE_DIR/public". Having set the following APP_BASE_DIR=/var/www, NGINX_WEBROOT is still set as "/var/www/html/public" in the container.

Expected Behavior

I expect the value of NGINX_WEBROOT to change depending on the value of APP_BASE_DIR.

Steps To Reproduce

  1. Add this line to the Dockerfile: ENV APP_BASE_DIR=/var/www
  2. Build the image, start the container and exec into it
  3. Run env | grep NGINX_WEBROOT

Host Operating System

macOS 14.4.1 (23E224)

Docker Version

Client:
 Version:           25.0.5
 API version:       1.44
 Go version:        go1.21.8
 Git commit:        5dc9bcc
 Built:             Tue Mar 19 15:02:31 2024
 OS/Arch:           darwin/amd64
 Context:           orbstack

Server: Docker Engine - Community
 Engine:
  Version:          25.0.5
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.8
  Git commit:       e63daec
  Built:            Tue Mar 19 15:05:39 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.7.13
  GitCommit:        7c3aca7a610df76212171d200ca3811ff6096eb8
 runc:
  Version:          1.1.12
  GitCommit:        51d5e94601ceffbbd85688df1c928ecccbfa4685
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Anything else?

No response

jaydrogers commented 5 months ago

Use the beta images and it should work. Sorry for the confusion!

jaydrogers commented 5 months ago

Oh wait… sorry, read the email too fast 🤣

I’ll take a look into this

jaydrogers commented 4 months ago

I just pushed up some clarity on this. I did some extra work to try and have the variables depend on each other, but unfortunately they get expanded on build and aren't referenced the way I intended at build.

I updated the docs with the added clarity: https://serversideup.net/open-source/docker-php/docs/reference/environment-variable-specification