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"
|
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"]
|
||||||
|
|
|
||||||
|
|
@ -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 />);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue