From 7d13c8e65e3cfda9ca8ebf84dd0e878cddb96eb2 Mon Sep 17 00:00:00 2001 From: Vivek Date: Mon, 8 Jun 2026 08:31:37 +0000 Subject: [PATCH] Add Dockerfile for Coolify deployment --- Dockerfile | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eb970a6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +# --------------------------------------------------------- +# Build stage +# --------------------------------------------------------- +FROM node:18-alpine AS builder + +# Install git (needed by some npm postinstall scripts) +RUN apk add --no-cache git + +WORKDIR /app + +# Install dependencies strictly from lockfile +COPY package.json package-lock.json* ./ +RUN npm ci + +# Copy source files +COPY . . + +# Build the Vite production bundle +ENV NODE_ENV=production +RUN npm run build + +# --------------------------------------------------------- +# Production stage – tiny static server +# --------------------------------------------------------- +FROM nginx:alpine + +# Remove default nginx config +RUN rm /etc/nginx/conf.d/default.conf + +# Copy custom config +COPY nginx.conf /etc/nginx/conf.d + +# Copy built assets +COPY --from=builder /app/dist /usr/share/nginx/html + +# Expose port (Coolify expects 80 by default) +EXPOSE 80 + +# Start nginx in foreground +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file