File tree 3 files changed +16
-11
lines changed
3 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -16,18 +16,22 @@ RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
16
16
COPY nginx.conf /etc/nginx/nginx.conf
17
17
COPY nginx-web.conf /etc/nginx/conf.d/default.conf
18
18
19
+ ARG NGINX_STATIC_DIR=/usr/share/nginx/html
19
20
# Copy pre-built catalog assets to nginx
20
- RUN rm -rf /usr/share/nginx/html
21
- COPY build /usr/share/nginx/html
21
+ RUN rm -rf $NGINX_STATIC_DIR
22
+ COPY build $NGINX_STATIC_DIR
22
23
23
24
# Copy config file
24
25
COPY config.json.tmpl config.json.tmpl
25
26
27
+ RUN ln -s /tmp/config.json $NGINX_STATIC_DIR/config.json && \
28
+ ln -s /tmp/config.js $NGINX_STATIC_DIR/config.js
29
+
26
30
# Use SIGQUIT for a "graceful" shutdown
27
31
STOPSIGNAL SIGQUIT
28
32
29
33
# Substitute environment variables into config.json and generate config.js based on that before starting nginx.
30
34
# Note: use "exec" because otherwise the shell will catch Ctrl-C and other signals.
31
- CMD envsubst < config.json.tmpl > /usr/share/nginx/html /config.json \
32
- && echo "window.QUILT_CATALOG_CONFIG = `cat /usr/share/nginx/html/ config.json`" > /usr/share/nginx/html /config.js \
35
+ CMD envsubst < config.json.tmpl > /tmp /config.json \
36
+ && echo "window.QUILT_CATALOG_CONFIG = `cat /tmp/ config.json`" > /tmp /config.js \
33
37
&& exec nginx -g 'daemon off;'
Original file line number Diff line number Diff line change @@ -34,11 +34,11 @@ RUN set -x \
34
34
--error-log-path=/dev/stdout \
35
35
--pid-path=/var/run/nginx.pid \
36
36
--lock-path=/var/run/nginx.lock \
37
- --http-client-body-temp-path=/var/cache /nginx/client_temp \
38
- --http-proxy-temp-path=/var/cache /nginx/proxy_temp \
39
- --http-fastcgi-temp-path=/var/cache /nginx/fastcgi_temp \
40
- --http-uwsgi-temp-path=/var/cache /nginx/uwsgi_temp \
41
- --http-scgi-temp-path=/var/cache /nginx/scgi_temp \
37
+ --http-client-body-temp-path=/var/lib /nginx/tmp /client_temp \
38
+ --http-proxy-temp-path=/var/lib /nginx/tmp /proxy_temp \
39
+ --http-fastcgi-temp-path=/var/lib /nginx/tmp /fastcgi_temp \
40
+ --http-uwsgi-temp-path=/var/lib /nginx/tmp /uwsgi_temp \
41
+ --http-scgi-temp-path=/var/lib /nginx/tmp /scgi_temp \
42
42
--user=nginx \
43
43
--group=nginx \
44
44
--with-compat \
@@ -77,9 +77,10 @@ RUN set -x \
77
77
RUN set -x \
78
78
&& useradd --system --user-group --no-create-home --home /nonexistent --shell /sbin/nologin nginx
79
79
80
- RUN mkdir /var/cache /nginx/
80
+ RUN mkdir -p /var/lib /nginx/tmp /
81
81
COPY nginx.conf /root/nginx.conf.tmpl
82
82
COPY run-nginx.sh /root/run-nginx.sh
83
+ RUN ln -sf /tmp/nginx.conf /etc/nginx/nginx.conf
83
84
84
85
# Use SIGQUIT for a "graceful" shutdown
85
86
STOPSIGNAL SIGQUIT
Original file line number Diff line number Diff line change 20
20
21
21
export NAMESERVER=$nameserver
22
22
23
- envsubst ' $INTERNAL_REGISTRY_URL $NAMESERVER' < /root/nginx.conf.tmpl > /etc/nginx /nginx.conf
23
+ envsubst ' $INTERNAL_REGISTRY_URL $NAMESERVER' < /root/nginx.conf.tmpl > /tmp /nginx.conf
24
24
25
25
exec nginx -g ' daemon off;'
You can’t perform that action at this time.
0 commit comments