Invalid docker .env file definition WWW_PATH

File directory:
.env
docker-compose.yml

.env:

-sharp 
ROOT_PATH=./services
-sharp 
WWW_PATH=./www

-sharp nginx
NGINX_WWW_DIR=$(WWW_PATH)

docker-compose.yml

- ${NGINX_WWW_DIR}:/data/www:rw

: Named volume "WWW_PATH:/data/www:rw" is used in service "nginx" but no declaration was found in the volumes section.
question:

.env?
Dec.08,2021

 NGINX_WWW_DIR=$(WWW_PATH)

you should remove the parentheses here

= >

 NGINX_WWW_DIR=$WWW_PATH
 

or change to curly braces

 NGINX_WWW_DIR=${WWW_PATH}
 
 

but according to the docker volume mapping rules, it is best to use the absolute path, that is,

 
 NGINX_WWW_DIR=$PWD/$WWW_PATH
 
 
 
-v should only accept absolute path.

I think of combining variables myself in docker-compose.yml.

such as $(ROOT_PATH) $(SUB_PATH)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3aa3b-2c221.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3aa3b-2c221.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?