diff --git a/frontend/dockerfile b/frontend/dockerfile index 4e3b528..912161e 100644 --- a/frontend/dockerfile +++ b/frontend/dockerfile @@ -1,22 +1,14 @@ -# --- Base build + production image --- -FROM node:20-slim AS app +FROM node:20-alpine as build-stage WORKDIR /app - -# Install dependencies needed to build sharp -RUN apt-get update && apt-get install -y \ - python3 \ - make \ - g++ \ - && rm -rf /var/lib/apt/lists/* - -# Copy package files and install dependencies +RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/* COPY package*.json ./ -RUN npm install - -# Copy project files and build +RUN npm install --force COPY . . RUN npm run build +FROM node:20-alpine as production-stage +WORKDIR /app +COPY --from=build-stage /app /app EXPOSE 3000 ENV NODE_ENV=production -CMD ["npm", "run", "start"] \ No newline at end of file +CMD ["npm", "run", "start"]