mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2025-06-28 09:15:12 +00:00
Split nginx configuration to several files
This commit is contained in:
10
Dockerfile
10
Dockerfile
@ -58,20 +58,24 @@ ENV TFW_TERMINADO_WD="/home/${AVATAO_USER}"
|
||||
ENV TFW_LIB_DIR="/usr/local/lib/"
|
||||
ENV TFW_SUPERVISORD_CONF="/etc/supervisor/supervisord.conf"
|
||||
ENV TFW_SUPERVISORD_COMPONENTS="/etc/supervisor/conf"
|
||||
ENV TFW_NGINX_CONF="/etc/nginx/sites-enabled/default"
|
||||
ENV TFW_NGINX_COMPONENTS="/etc/nginx/components"
|
||||
ENV PYTHONPATH=${TFW_LIB_DIR}
|
||||
|
||||
COPY nginx /etc/nginx
|
||||
COPY lib ${TFW_LIB_DIR}
|
||||
COPY supervisor/supervisord.conf ${TFW_SUPERVISORD_CONF}
|
||||
COPY supervisor/components/ ${TFW_SUPERVISORD_COMPONENTS}
|
||||
COPY nginx/nginx.conf ${TFW_NGINX_CONF}
|
||||
COPY nginx/components/ ${TFW_NGINX_COMPONENTS}
|
||||
COPY src/app ${TFW_APP_DIR}
|
||||
COPY src/event_handlers ${TFW_EVENT_HANDLERS_DIR}
|
||||
|
||||
RUN chown -R ${AVATAO_USER}: /var/log/nginx /var/lib/nginx &&\
|
||||
# nginx runs as a regular user, and can't write to /run
|
||||
sed -i 's#pid /run/nginx.pid;#pid /tmp/nginx.pid;#g' /etc/nginx/nginx.conf &&\
|
||||
envsubst "$(printenv | cut -d= -f1 | grep TFW_ | sed -e 's/^/$/g')" \
|
||||
< /etc/nginx/sites-available/default > /etc/nginx/sites-available/default &&\
|
||||
for f in "${TFW_NGINX_CONF}" ${TFW_NGINX_COMPONENTS}/*.conf; do \
|
||||
envsubst "$(printenv | cut -d= -f1 | grep TFW_ | sed -e 's/^/$/g')" < $f > $f ;\
|
||||
done &&\
|
||||
mv /data/dist ${TFW_FRONTEND_DIR}
|
||||
|
||||
USER ${AVATAO_USER}
|
||||
|
Reference in New Issue
Block a user