From bc763b0f807c2f9d31b45d7c90aa572573736249 Mon Sep 17 00:00:00 2001 From: Marcio Bevervanso Date: Tue, 17 Feb 2026 18:00:11 -0300 Subject: [PATCH] chore: add Dockerfile and nginx config for deployment --- .dockerignore | 7 +++++++ Dockerfile | 20 ++++++++++++++++++++ nginx.conf | 17 +++++++++++++++++ 3 files changed, 44 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..1cecba6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +node_modules +dist +.git +.env +.vscode +supabase +.DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e457139 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Stage 1: Build +FROM node:20-alpine as builder + +WORKDIR /app + +COPY package*.json ./ +RUN npm install + +COPY . . +RUN npm run build + +# Stage 2: Serve +FROM nginx:alpine + +COPY --from=builder /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..8230132 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,17 @@ +server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + # Cache static assets + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { + expires 1y; + add_header Cache-Control "public, no-transform"; + } +}