Add readonly-fs compatible configuration for nginx

This commit is contained in:
Kristóf Tóth 2018-03-14 09:06:28 +01:00
parent 49b728ee6c
commit 3caf170c7d
2 changed files with 31 additions and 5 deletions

View File

@ -55,7 +55,8 @@ ENV PYTHONPATH="/usr/local/lib/" \
TFW_SUPERVISOR_HTTP_URI="http://localhost:${TFW_SUPERVISOR_HTTP_PORT}" \ TFW_SUPERVISOR_HTTP_URI="http://localhost:${TFW_SUPERVISOR_HTTP_PORT}" \
TFW_SUPERVISORD_CONF="/etc/supervisor/supervisord.conf" \ TFW_SUPERVISORD_CONF="/etc/supervisor/supervisord.conf" \
TFW_SUPERVISORD_COMPONENTS="/etc/supervisor/conf" \ TFW_SUPERVISORD_COMPONENTS="/etc/supervisor/conf" \
TFW_NGINX_CONF="/etc/nginx/sites-enabled/default" \ TFW_NGINX_CONF="/etc/nginx/nginx.conf" \
TFW_NGINX_DEFAULT="/etc/nginx/sites-enabled/default" \
TFW_NGINX_COMPONENTS="/etc/nginx/components" \ TFW_NGINX_COMPONENTS="/etc/nginx/components" \
TFW_LIB_DIR="/usr/local/lib/" \ TFW_LIB_DIR="/usr/local/lib/" \
TFW_CONTROLLER_DIR="/srv/controller" \ TFW_CONTROLLER_DIR="/srv/controller" \
@ -73,11 +74,12 @@ RUN echo "shopt -s cmdhist\n" \
'PROMPT_COMMAND="history -a"\n' \ 'PROMPT_COMMAND="history -a"\n' \
>> /home/${AVATAO_USER}/.bashrc >> /home/${AVATAO_USER}/.bashrc
COPY nginx/default.conf ${TFW_NGINX_CONF} COPY nginx/nginx.conf ${TFW_NGINX_CONF}
COPY nginx/default.conf ${TFW_NGINX_DEFAULT}
COPY nginx/components/ ${TFW_NGINX_COMPONENTS} COPY nginx/components/ ${TFW_NGINX_COMPONENTS}
RUN chown -R ${AVATAO_USER} /var/log/nginx /var/lib/nginx &&\ RUN chown -R ${AVATAO_USER} /var/log/nginx /var/lib/nginx &&\
sed -i 's#pid /run/nginx.pid;#pid /tmp/nginx.pid;#g' /etc/nginx/nginx.conf &&\ sed -i 's#pid /run/nginx.pid;#pid /tmp/nginx.pid;#g' /etc/nginx/nginx.conf &&\
for f in "${TFW_NGINX_CONF}" ${TFW_NGINX_COMPONENTS}/*.conf; do \ for f in "${TFW_NGINX_DEFAULT}" ${TFW_NGINX_COMPONENTS}/*.conf; do \
envsubst "$(printenv | cut -d= -f1 | grep TFW_ | sed -e 's/^/$/g')" < $f > $f~ && mv $f~ $f ;\ envsubst "$(printenv | cut -d= -f1 | grep TFW_ | sed -e 's/^/$/g')" < $f > $f~ && mv $f~ $f ;\
done done

24
nginx/nginx.conf Normal file
View File

@ -0,0 +1,24 @@
worker_processes auto;
pid /tmp/nginx.pid;
events
{
worker_connections 1024;
}
http
{
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout;
error_log /dev/stderr;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}