Browse Source

Write logs to a volume

master
Chris Smith 5 years ago
parent
commit
d5046eb4de
2 changed files with 2 additions and 1 deletions
  1. 1
    0
      Dockerfile
  2. 1
    1
      nginx.conf

+ 1
- 0
Dockerfile View File

41
 FROM nginx:mainline-alpine AS nginx
41
 FROM nginx:mainline-alpine AS nginx
42
 COPY --from=minify /tmp/site /usr/share/nginx/html
42
 COPY --from=minify /tmp/site /usr/share/nginx/html
43
 ADD nginx.conf /etc/nginx/nginx.conf
43
 ADD nginx.conf /etc/nginx/nginx.conf
44
+VOLUME /logs

+ 1
- 1
nginx.conf View File

18
                       '$status $body_bytes_sent "$http_referer" '
18
                       '$status $body_bytes_sent "$http_referer" '
19
                       '"$http_user_agent" "$http_x_forwarded_for"';
19
                       '"$http_user_agent" "$http_x_forwarded_for"';
20
 
20
 
21
-    access_log  /var/log/nginx/access.log  main;
21
+    access_log  /logs/access.log  main;
22
 
22
 
23
     sendfile        on;
23
     sendfile        on;
24
 
24
 

Loading…
Cancel
Save