ADD: Set up Docker environment with Dockerfile and nginx configuration

This commit is contained in:
2026-04-28 12:11:45 +02:00
parent 599fb59f24
commit 9779fa8c55
3 changed files with 46 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
node_modules
npm-debug.log
dist
.git
.gitignore
.idea
.vscode
Dockerfile
README.md
+16
View File
@@ -0,0 +1,16 @@
FROM node:22-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM nginxinc/nginx-unprivileged:1.27-alpine AS runtime
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 8000
CMD ["nginx", "-g", "daemon off;"]
+20
View File
@@ -0,0 +1,20 @@
server {
listen 8000;
server_name _;
root /usr/share/nginx/html;
index index.html;
server_tokens off;
location / {
try_files $uri $uri/ /index.html;
}
location ~* \.(?:css|js|mjs|json|ico|png|jpg|jpeg|gif|svg|webp|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
}