fix: add docker scripts

This commit is contained in:
Nikolai Giman
2026-02-21 18:36:22 +01:00
parent b2eab9ec61
commit 1064b88902
3 changed files with 52 additions and 0 deletions
+9
View File
@@ -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
+8
View File
@@ -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;"]
+35
View File
@@ -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;
}