diff --git a/Dockerfile b/Dockerfile index e69de29..5d547a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM node:22-alpine AS builder + +WORKDIR /app + +COPY package*.json ./ +RUN npm install --frozen-lockfile + +COPY . . +RUN npm run build + +FROM nginx:alpine + +RUN rm -rf /usr/share/nginx/html/* + +COPY --from=builder /app/dist /usr/share/nginx/html + +RUN rm /etc/nginx/conf.d/default.conf +RUN echo 'server { \ + listen 80; \ + server_name _; \ + root /usr/share/nginx/html; \ + index index.html; \ + location / { \ + try_files $uri /index.html; \ + } \ + error_page 404 /index.html; \ +}' > /etc/nginx/conf.d/default.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] += \ No newline at end of file