fix the dockerfile of the frontend

This commit is contained in:
maxDorninger
2025-07-01 17:36:53 +02:00
parent 19bc4ca5e3
commit 9c27825532
2 changed files with 4 additions and 25 deletions

View File

@@ -5,33 +5,28 @@ WORKDIR /app
ARG VERSION
ARG BASE_URL
# Copy package files first for better layer caching
COPY package*.json ./
RUN npm ci && npm cache clean --force
# Copy source code after dependencies are installed
COPY . .
RUN env PUBLIC_VERSION=${VERSION} BASE_URL=${BASE_URL} npm run build
FROM node:24-alpine AS frontend
ARG VERSION
USER node
EXPOSE 3000
WORKDIR /app
LABEL version=${VERSION}
LABEL description="Docker image for the web frontend of MediaManager"
ENV PUBLIC_VERSION=${VERSION}
ENV PUBLIC_SSR_WEB=false
COPY --from=build /app/build ./build
COPY --from=build /app/package*.json ./
COPY --chmod=755 entrypoint.sh ./entrypoint.sh
RUN npm ci --only=production
CMD ["/app/entrypoint.sh"]
RUN npm ci --omit=dev
EXPOSE 3000
USER node
CMD ["node","build/index.js"]