fixed dockerfile
This commit is contained in:
parent
f0277d6006
commit
7e8f70302f
22
Dockerfile
22
Dockerfile
|
|
@ -5,26 +5,22 @@ FROM node:22-bullseye AS builder
|
|||
|
||||
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
|
||||
|
||||
# Copy Yarn 4 files
|
||||
COPY package.json yarn.lock .yarnrc.yml ./
|
||||
COPY .yarn .yarn
|
||||
# Copy package.json and package-lock.json
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies (immutable to match lockfile)
|
||||
RUN yarn install --immutable
|
||||
# Install dependencies
|
||||
RUN npm ci
|
||||
|
||||
# Copy all source files
|
||||
# Copy source files
|
||||
COPY . .
|
||||
|
||||
# Pass API URL to Vite
|
||||
ENV VITE_API_BASE_URL=$API_BASE_URL
|
||||
|
||||
# Build the app
|
||||
RUN yarn build
|
||||
RUN npm run build
|
||||
|
||||
|
||||
# ------------------------
|
||||
|
|
@ -34,14 +30,14 @@ FROM node:22-alpine AS production
|
|||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy built files from builder stage
|
||||
# Copy build output from builder
|
||||
COPY --from=builder /app/dist ./dist
|
||||
|
||||
# Install a lightweight static server
|
||||
RUN npm install -g serve@14
|
||||
|
||||
# Expose port (optional but recommended)
|
||||
# Expose port
|
||||
EXPOSE 3000
|
||||
|
||||
# Start the static server
|
||||
# Start the app
|
||||
CMD ["serve", "-s", "dist", "-l", "3000"]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
import { createRoot } from "react-dom/client";
|
||||
import App from "./App.tsx";
|
||||
import "./index.css";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import App from "./App.tsx";
|
||||
// import "./index.css";
|
||||
|
||||
createRoot(document.getElementById("root")!).render(<App />);
|
||||
|
||||
createRoot(document.getElementById("root")!).render(<App />);
|
||||
|
|
|
|||
Loading…
Reference in New Issue