diff --git a/.dockerignore b/.dockerignore index da67572..027a87a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,9 +4,9 @@ npm-debug.log .gitignore README.md .env +.env.* .nyc_output coverage -.nyc_output .vscode .DS_Store dist \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index f65703a..a66b656 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Multi-stage build for production -FROM node:18-alpine AS build-stage +FROM node:20-alpine AS build-stage # Set working directory WORKDIR /app @@ -8,7 +8,8 @@ WORKDIR /app COPY package*.json ./ # Install dependencies -RUN npm ci +#ENV NODE_ENV=production +RUN npm ci --no-audit --no-fund # Copy source code COPY . . @@ -29,4 +30,5 @@ COPY nginx.conf /etc/nginx/nginx.conf EXPOSE 80 # Start nginx +HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD wget -qO- http://localhost/healthz >/dev/null 2>&1 || exit 1 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index ad8b806..e6e5c8a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -5,22 +5,45 @@ events { http { include /etc/nginx/mime.types; default_type application/octet-stream; + sendfile on; + etag on; + gzip on; + gzip_comp_level 5; + gzip_min_length 1024; + gzip_types + text/plain text/css application/json application/javascript + text/xml application/xml application/xml+rss image/svg+xml; server { listen 80; - server_name localhost; + server_name _; root /usr/share/nginx/html; index index.html; + + add_header X-Content-Type-Options "nosniff" always; + add_header X-Frame-Options "DENY" always; + add_header Referrer-Policy "strict-origin-when-cross-origin" always; + add_header Permissions-Policy "geolocation=(), microphone=(), camera=()" always; # Handle client-side routing location / { try_files $uri $uri/ /index.html; } + + location = /index.html { + add_header Cache-Contrl "no-store, no-cache, must-revalidate"; + expires -1; + } # Cache static assets location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { expires 1y; add_header Cache-Control "public, immutable"; } + + location = healthz { + default_type text/plain; + return 200 'ok'; + } } } \ No newline at end of file diff --git a/src/components/UserLogin.vue b/src/components/UserLogin.vue index 4fc12c8..e2b2573 100644 --- a/src/components/UserLogin.vue +++ b/src/components/UserLogin.vue @@ -113,7 +113,7 @@
-

Don't have an account?

+

Don't have an account?

diff --git a/src/components/UserSignup.vue b/src/components/UserSignup.vue index bb7f18e..a58f755 100644 --- a/src/components/UserSignup.vue +++ b/src/components/UserSignup.vue @@ -84,6 +84,7 @@ :class="{ 'error': error && !email }" placeholder="Enter your email" required + autocomplete="email" /> @@ -100,6 +101,7 @@ :class="{ 'error': error && !password }" placeholder="Create a password" required + autocomplete="new-password" />