fixed dockerfile
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
hardik 2025-09-28 20:42:20 +05:30
parent f0277d6006
commit 7e8f70302f
2 changed files with 13 additions and 18 deletions

View File

@ -5,26 +5,22 @@ FROM node:22-bullseye AS builder
ARG API_BASE_URL="https://navigolabs.com/api" ARG API_BASE_URL="https://navigolabs.com/api"
# Enable Corepack and Yarn 4
RUN corepack enable && corepack prepare yarn@4.9.2 --activate
WORKDIR /app WORKDIR /app
# Copy Yarn 4 files # Copy package.json and package-lock.json
COPY package.json yarn.lock .yarnrc.yml ./ COPY package*.json ./
COPY .yarn .yarn
# Install dependencies (immutable to match lockfile) # Install dependencies
RUN yarn install --immutable RUN npm ci
# Copy all source files # Copy source files
COPY . . COPY . .
# Pass API URL to Vite # Pass API URL to Vite
ENV VITE_API_BASE_URL=$API_BASE_URL ENV VITE_API_BASE_URL=$API_BASE_URL
# Build the app # Build the app
RUN yarn build RUN npm run build
# ------------------------ # ------------------------
@ -34,14 +30,14 @@ FROM node:22-alpine AS production
WORKDIR /app WORKDIR /app
# Copy built files from builder stage # Copy build output from builder
COPY --from=builder /app/dist ./dist COPY --from=builder /app/dist ./dist
# Install a lightweight static server # Install a lightweight static server
RUN npm install -g serve@14 RUN npm install -g serve@14
# Expose port (optional but recommended) # Expose port
EXPOSE 3000 EXPOSE 3000
# Start the static server # Start the app
CMD ["serve", "-s", "dist", "-l", "3000"] CMD ["serve", "-s", "dist", "-l", "3000"]

View File

@ -1,7 +1,6 @@
import { createRoot } from "react-dom/client"; import { createRoot } from "react-dom/client";
import App from "./App.tsx"; import App from "./App.tsx";
import "./index.css"; // import "./index.css";
createRoot(document.getElementById("root")!).render(<App />);
createRoot(document.getElementById("root")!).render(<App />);