Skip to content

Commit 68d2f8c

Browse files
committed
[Fixes #37] nginx uses hardcoded mount positions
1 parent cf60723 commit 68d2f8c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

docker/nginx/docker-entrypoint.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ export GEONODE_LB_PORT=${GEONODE_LB_PORT:-8000}
4444
export GEOSERVER_LB_HOST_IP=${GEOSERVER_LB_HOST_IP:-geoserver}
4545
export GEOSERVER_LB_PORT=${GEOSERVER_LB_PORT:-8080}
4646

47-
echo "Replacing environement variables"
48-
envsubst '\$HTTP_HOST \$HTTPS_HOST \$HTTP_SCHEME \$GEONODE_LB_HOST_IP \$GEONODE_LB_PORT \$GEOSERVER_LB_HOST_IP \$GEOSERVER_LB_PORT \$RESOLVER' < /etc/nginx/nginx.conf.envsubst > /etc/nginx/nginx.conf
49-
envsubst '\$HTTP_HOST \$HTTPS_HOST \$HTTP_SCHEME \$GEONODE_LB_HOST_IP \$GEONODE_LB_PORT \$GEOSERVER_LB_HOST_IP \$GEOSERVER_LB_PORT \$RESOLVER' < /etc/nginx/nginx.https.available.conf.envsubst > /etc/nginx/nginx.https.available.conf
50-
envsubst '\$HTTP_HOST \$HTTPS_HOST \$HTTP_SCHEME \$GEONODE_LB_HOST_IP \$GEONODE_LB_PORT \$GEOSERVER_LB_HOST_IP \$GEOSERVER_LB_PORT' < /etc/nginx/sites-enabled/geonode.conf.envsubst > /etc/nginx/sites-enabled/geonode.conf
47+
defined_envs=$(printf '${%s} ' $(env | cut -d= -f1))
48+
49+
echo "Replacing environment variables"
50+
envsubst "$defined_envs" < /etc/nginx/nginx.conf.envsubst > /etc/nginx/nginx.conf
51+
envsubst "$defined_envs" < /etc/nginx/nginx.https.available.conf.envsubst > /etc/nginx/nginx.https.available.conf
52+
envsubst "$defined_envs" < /etc/nginx/sites-enabled/geonode.conf.envsubst > /etc/nginx/sites-enabled/geonode.conf
5153

5254
echo "Enabling or not https configuration"
5355
if [ -z "${HTTPS_HOST}" ]; then

docker/nginx/geonode.conf.envsubst

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ location /geoserver {
6262

6363
# GeoNode
6464
location /static/ {
65-
alias /mnt/volumes/statics/static/;
65+
alias $STATIC_ROOT;
6666

6767
location ~* \.(?:html|js|jpg|jpeg|gif|png|css|tgz|gz|rar|bz2|doc|pdf|ppt|tar|wav|bmp|ttf|rtf|swf|ico|flv|txt|woff|woff2|svg|xml)$ {
6868
gzip_static always;
@@ -74,7 +74,7 @@ location /static/ {
7474
}
7575

7676
location /uploaded/ {
77-
alias /mnt/volumes/statics/uploaded/;
77+
alias $MEDIA_ROOT;
7878

7979
location ~* \.(?:html|js|jpg|jpeg|gif|png|css|tgz|gz|rar|bz2|doc|pdf|ppt|tar|wav|bmp|ttf|rtf|swf|ico|flv|txt|woff|woff2|svg|xml)$ {
8080
gzip_static always;

0 commit comments

Comments
 (0)