From c39240456bd8868ae85981154b6a98f20311f5cf Mon Sep 17 00:00:00 2001 From: mahyargdz Date: Fri, 28 Feb 2025 23:13:54 +0330 Subject: [PATCH] update: change npm install to npm ci --- Dockerfile | 4 ++-- nginx.conf | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 504259a..9c66677 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20-alpine AS builder +FROM node:22-alpine AS builder # Install tzdata to support timezone settings RUN apk add --no-cache tzdata @@ -8,7 +8,7 @@ RUN cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && echo "Asia/Tehran" > /e WORKDIR /build COPY package*.json ./ -RUN npm install +RUN npm ci --legacy-peer-deps COPY . ./ RUN npm run build diff --git a/nginx.conf b/nginx.conf index c7189fb..59efa68 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,4 +1,11 @@ server { + + add_header X-Frame-Options DENY always; + add_header X-Content-Type-Options nosniff; + add_header X-XSS-Protection "1; mode=block" always; + add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; + + listen 80; server_name localhost; @@ -13,7 +20,12 @@ server { root /usr/share/nginx/html; } - location /health { - return 200; - } + # location /health { + # return 200; + # } + + location ~ /\. { + deny all; + return 403; + } } \ No newline at end of file