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