diff --git a/web-nuxt-ui/build-docker-web.sh b/web-nuxt-ui/build-docker-web.sh new file mode 100644 index 0000000..9829037 --- /dev/null +++ b/web-nuxt-ui/build-docker-web.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# This script builds the docker image for the taskview-ce-webapp + +VERSION=$1 + +pnpm build + +docker buildx build --platform=linux/amd64,linux/arm64 -t gimanhead/taskview-ce-webapp:$VERSION -t gimanhead/taskview-ce-webapp:latest . --load \ No newline at end of file diff --git a/web-nuxt-ui/dockerfile b/web-nuxt-ui/dockerfile new file mode 100644 index 0000000..335fcb5 --- /dev/null +++ b/web-nuxt-ui/dockerfile @@ -0,0 +1,8 @@ +FROM nginx:alpine + +COPY dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/web-nuxt-ui/nginx.conf b/web-nuxt-ui/nginx.conf new file mode 100644 index 0000000..2145dfa --- /dev/null +++ b/web-nuxt-ui/nginx.conf @@ -0,0 +1,35 @@ +server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + + # Gzip compression + gzip on; + gzip_vary on; + gzip_min_length 1024; + gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss application/json application/javascript; + + # Security headers + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Content-Type-Options "nosniff" always; + add_header X-XSS-Protection "1; mode=block" always; + + location / { + try_files $uri $uri/ /index.html; + } + + # Cache static assets + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } + + # Don't cache index.html + location = /index.html { + add_header Cache-Control "no-cache, no-store, must-revalidate"; + } + + error_page 404 /index.html; +} +