From c7ba7586b866a179fa9ecb52cceb77ab694b0cb3 Mon Sep 17 00:00:00 2001 From: Tiago Yamamoto Date: Sat, 7 Mar 2026 12:02:03 -0600 Subject: [PATCH] feat: add Dockerfile for frontend deployment --- frontend/Dockerfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 frontend/Dockerfile diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..49d7fe0 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,32 @@ +# Build stage +FROM node:20-alpine AS builder + +WORKDIR /app + +# Copy package files and install dependencies +COPY package.json package-lock.json ./ +RUN npm ci + +# Copy source code and build +COPY . . +RUN npm run build + +# Production stage (Nginx) +FROM nginx:alpine + +# Copy built files to Nginx +COPY --from=builder /app/dist /usr/share/nginx/html + +# Default Nginx config for Single Page Apps (Vite) +RUN echo 'server { \ + listen 80; \ + location / { \ + root /usr/share/nginx/html; \ + index index.html; \ + try_files $uri $uri/ /index.html; \ + } \ +}' > /etc/nginx/conf.d/default.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"]