“vinit5112” commited on
Commit
5eb5663
·
1 Parent(s): 748c488

fix: redirect nginx logs to writable path

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -0
  2. frontend/nginx.conf +3 -1
Dockerfile CHANGED
@@ -42,6 +42,9 @@ RUN rm -rf /usr/share/nginx/html && \
42
  RUN mkdir -p /app/tmp/body /app/tmp/proxy /app/tmp/fastcgi /app/tmp/uwsgi /app/tmp/scgi && \
43
  chmod -R 777 /app/tmp
44
 
 
 
 
45
  # Copy start script
46
  COPY start.sh /start.sh
47
  RUN chmod +x /start.sh
 
42
  RUN mkdir -p /app/tmp/body /app/tmp/proxy /app/tmp/fastcgi /app/tmp/uwsgi /app/tmp/scgi && \
43
  chmod -R 777 /app/tmp
44
 
45
+ # Create log directory for NGINX
46
+ RUN mkdir -p /app/logs && chmod -R 777 /app/logs
47
+
48
  # Copy start script
49
  COPY start.sh /start.sh
50
  RUN chmod +x /start.sh
frontend/nginx.conf CHANGED
@@ -1,7 +1,9 @@
1
  # Remove or comment out `user` directive if it's elsewhere
2
  # user nginx;
3
 
4
- # Set custom temp directories to avoid permission errors
 
 
5
  client_body_temp_path /app/tmp/body;
6
  proxy_temp_path /app/tmp/proxy;
7
  fastcgi_temp_path /app/tmp/fastcgi;
 
1
  # Remove or comment out `user` directive if it's elsewhere
2
  # user nginx;
3
 
4
+ error_log /app/logs/error.log warn;
5
+ access_log /app/logs/access.log;
6
+
7
  client_body_temp_path /app/tmp/body;
8
  proxy_temp_path /app/tmp/proxy;
9
  fastcgi_temp_path /app/tmp/fastcgi;