diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3d34560 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:22 as build +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build + +FROM nginx:alpine +COPY --from=build /app/build /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf +EXPOSE 5137 +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..64d4d10 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,14 @@ +server { + listen 5137; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location ~* \.(?:jpg|jpeg|gif|png|ico|svg|woff|woff2|ttf|css|js)$ { + expires 30d; + add_header Cache-Control "public, no-transform"; + } +} \ No newline at end of file