diff --git a/Dockerfile b/Dockerfile index 986944839900a07232edba2c75b3977fa6f81bec..aaef0d32c6f7c198253f74bf93793b8fffb7d1c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,10 +74,10 @@ COPY . /usr/src/app RUN npm run generate ### STAGE: NGINX ### -FROM nginxinc/nginx-unprivileged:1.25-bookworm - -RUN apt update -y && apt install rsync -y +FROM nginx:1.25-bookworm # RUN rm -rf /usr/share/nginx/html/* -# COPY nginx.conf /etc/nginx/conf.d/default.conf -COPY --from=generate /usr/src/app/.output/public /etc/nginx/html +RUN apt update -y && apt install -y +COPY nginx.conf /etc/nginx/nginx.conf +COPY --from=generate /usr/src/app/.output/public /usr/share/nginx/html +USER nginx CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index daf15e6523f33f4bdbf340815efaae126bf758e3..f4949d5397d249ca47260c2db33c4e8d4513a2ba 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,16 +1,38 @@ -server_tokens off; -server { - listen 8080; - server_name localhost; - location /wiki { - alias /etc/nginx/html/; - index index.html index.htm; - try_files $uri $uri/ $uri/index.html /index.html; - - } - error_page 500 502 503 504 /50x.html; - location = /50x.html { - alias /etc/nginx/html/; - } - -} \ No newline at end of file +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log notice; +pid /tmp/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; + client_body_temp_path /tmp/client_temp; + proxy_temp_path /tmp/proxy_temp_path; + fastcgi_temp_path /tmp/fastcgi_temp; + uwsgi_temp_path /tmp/uwsgi_temp; + scgi_temp_path /tmp/scgi_temp; + +} +