fix/ssh_issue #10

Merged
hardik merged 4 commits from fix/ssh_issue into main 2025-09-28 21:00:45 +05:30
1 changed files with 45 additions and 6 deletions
Showing only changes of commit f0277d6006 - Show all commits

View File

@ -1,8 +1,47 @@
# Use lightweight Nginx image
FROM scratch
# ------------------------
# Build stage
# ------------------------
FROM node:22-bullseye AS builder
# Copy your HTML/CSS/JS files into nginx's web root
COPY . /app/build
ARG API_BASE_URL="https://navigolabs.com/api"
# Start nginx
CMD ["tail", "-f", "/dev/null"]
# 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
# Install dependencies (immutable to match lockfile)
RUN yarn install --immutable
# Copy all source files
COPY . .
# Pass API URL to Vite
ENV VITE_API_BASE_URL=$API_BASE_URL
# Build the app
RUN yarn build
# ------------------------
# Production stage
# ------------------------
FROM node:22-alpine AS production
WORKDIR /app
# Copy built files from builder stage
COPY --from=builder /app/dist ./dist
# Install a lightweight static server
RUN npm install -g serve@14
# Expose port (optional but recommended)
EXPOSE 3000
# Start the static server
CMD ["serve", "-s", "dist", "-l", "3000"]