Add Dockerfile for Coolify deployment

This commit is contained in:
Vivek 2026-06-08 08:31:37 +00:00
parent e244b9f9fd
commit 7d13c8e65e

40
Dockerfile Normal file
View file

@ -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;"]