mirror of
https://github.com/hnhx/librex.git
synced 2025-04-29 14:09:27 -04:00
chore: after running the 'docker run' command, the environment variables will now be effective
This commit is contained in:
parent
3bd1ba068b
commit
36d8aeeb5b
2 changed files with 10 additions and 7 deletions
|
@ -1,9 +1,3 @@
|
||||||
RUN apk add nginx
|
RUN apk add nginx
|
||||||
|
|
||||||
ADD "docker/server/fastcgi.conf" /etc/nginx/fastcgi.conf
|
|
||||||
ADD "docker/server/nginx.conf" /etc/nginx/http.d/librex.conf
|
|
||||||
|
|
||||||
RUN chmod u+x "/etc/nginx/fastcgi.conf" &&\
|
|
||||||
chmod u+x "/etc/nginx/http.d/librex.conf"
|
|
||||||
|
|
||||||
CMD [ "/bin/sh", "-c", "docker/server/prepare.sh" ]
|
CMD [ "/bin/sh", "-c", "docker/server/prepare.sh" ]
|
||||||
|
|
|
@ -14,4 +14,13 @@ export OPEN_SEARCH_HOST_FOR_NGINX="$(echo "${OPEN_SEARCH_HOST}" | cut -d "/" -f
|
||||||
|
|
||||||
# The lines below will replace the environment variables in the templates with the corresponding variables listed above. To accomplish this, the GNU 'envsubst' package will be used
|
# The lines below will replace the environment variables in the templates with the corresponding variables listed above. To accomplish this, the GNU 'envsubst' package will be used
|
||||||
# Although not recommended (if you do not know what you are doing), you still have the option to add new substitution file templates using any required environment variables
|
# Although not recommended (if you do not know what you are doing), you still have the option to add new substitution file templates using any required environment variables
|
||||||
[[ ! -s ${CONFIG_NGINX_TEMPLATE} ]] && cat 'docker/server/nginx.conf' | envsubst '${OPEN_SEARCH_HOST_FOR_NGINX}' > ${CONFIG_NGINX_TEMPLATE};
|
if [[ ! -s ${CONFIG_NGINX_TEMPLATE} ]]; then
|
||||||
|
cp "docker/server/fastcgi.conf" /etc/nginx/fastcgi.conf
|
||||||
|
cp "docker/server/nginx.conf" /etc/nginx/http.d/librex.conf
|
||||||
|
|
||||||
|
# To address issues with 'nginx.conf', the following lines will ensure that these configurations remain executable
|
||||||
|
chmod u+x "/etc/nginx/fastcgi.conf"
|
||||||
|
chmod u+x "/etc/nginx/http.d/librex.conf"
|
||||||
|
|
||||||
|
cat 'docker/server/nginx.conf' | envsubst '${OPEN_SEARCH_HOST_FOR_NGINX}' > ${CONFIG_NGINX_TEMPLATE};
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue