From 8453a4e400d8dc09478eb5579c67c5578d6b3ba9 Mon Sep 17 00:00:00 2001 From: Parsa Nazer Date: Mon, 10 Nov 2025 13:36:36 +0330 Subject: [PATCH] npm only --- frontend/dockerfile | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/frontend/dockerfile b/frontend/dockerfile index 56b7d8e..fb5d313 100644 --- a/frontend/dockerfile +++ b/frontend/dockerfile @@ -1,31 +1,25 @@ -FROM oven/bun:1 AS build-stage +# --- Base build + production image --- +FROM node:20-slim AS app WORKDIR /app -# Install sharp dependencies for Linux +# Install dependencies needed to build sharp RUN apt-get update && apt-get install -y \ python3 \ make \ g++ \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* -COPY package.json bun.lockb* ./ -RUN bun install --frozen-lockfile +# Copy package files and install dependencies +COPY package*.json ./ +RUN npm ci --omit=dev +# Copy project files and build COPY . . -RUN bun run build - -FROM oven/bun:1 AS production-stage -WORKDIR /app - -# Install sharp dependencies in production stage as well -RUN apt-get update && apt-get install -y \ - python3 \ - make \ - g++ \ - && rm -rf /var/lib/apt/lists/* - -COPY --from=build-stage /app /app +RUN npm run build +# Expose port and set env vars EXPOSE 3000 ENV NODE_ENV=production -CMD ["bun", "run", "start"] \ No newline at end of file + +# Start the app +CMD ["npm", "run", "start"] \ No newline at end of file