From 6d3a139f3485d5f0c13b419535003ee23dd568ab Mon Sep 17 00:00:00 2001 From: DerTyp7 Date: Sun, 24 Aug 2025 16:52:27 +0200 Subject: [PATCH] Implemented Dockerfile --- .dockerignore | 5 +++++ Dockerfile | 15 +++++++++++++++ nginx.conf | 14 ++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 nginx.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9f4e5cc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.github +.gitignore +README.md +dist +node_modules diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bf431f1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:18-alpine AS build + +WORKDIR /app +COPY package*.json ./ +RUN npm ci +COPY . . +RUN npm run build + +FROM nginx:alpine + +COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=build /app/dist /usr/share/nginx/html + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..7857721 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,14 @@ +server { + listen 80; + root /usr/share/nginx/html; + index index.html index.htm; + + location / { + try_files $uri $uri/ /index.html; + } + + error_page 404 /index.html; + location = /index.html { + internal; + } +} \ No newline at end of file