diff --git a/Dockerfile b/Dockerfile index 9ecf1c5..61d1478 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,39 +1,38 @@ # --------------------------------------------------------- +# --------------------------------------------------------- # Build stage # --------------------------------------------------------- FROM node:18-alpine AS builder -# Install dependencies +# Install git (only needed for npm postinstall scripts) RUN apk add --no-cache git WORKDIR /app # Copy package files COPY package.json ./ - -# Install dependencies RUN npm install -# Copy source files +# Copy the rest of the source tree COPY . . -# Build the Vite production bundle +# Build the production bundle (Vite outputs to `dist/`) ENV NODE_ENV=production RUN npm run build +# DEBUG: Confirm build output exists before proceeding +RUN echo "=== BUILD OUTPUT CHECK ===" && \ + ls -la /app/dist && \ + cat /app/dist/index.html 2>/dev/null | head -n 5 || echo "ERROR: INDEX NOT FOUND - build may have failed silently" + # --------------------------------------------------------- -# Production stage – tiny static server +# Production stage – tiny static server (nginx) # --------------------------------------------------------- FROM nginx:alpine -# Copy only our custom config COPY nginx.conf /etc/nginx/conf.d/default.conf -# 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 diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..6aad515 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; + +export default defineConfig({ + plugins: [react()], + build: { + outDir: 'dist', + sourcemap: false, + }, +}); \ No newline at end of file