fix the docker files and startup scripts, also fix a bug in the hello world route of the backend

This commit is contained in:
maxDorninger
2025-06-30 17:17:21 +02:00
parent a3a61710d3
commit 4d67db6545
5 changed files with 31 additions and 26 deletions

View File

@@ -1,37 +1,39 @@
ARG VERSION
ARG BASE_URL=""
FROM node:24-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production && npm cache clean --force
FROM node:24-alpine AS build
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 package*.json ./
COPY --chmod=755 mediamanager-frontend-startup.sh ./
# Copy built application and package files
COPY --from=build /app/build ./build
COPY --from=build /app/package*.json ./
COPY --chmod=755 entrypoint.sh .
COPY --from=deps /app/node_modules ./node_modules
# Install only production dependencies needed for the Node adapter
RUN npm ci --only=production && npm cache clean --force
CMD ["/app/entrypoint.sh"]
EXPOSE 3000
USER node
CMD ["/app/mediamanager-frontend-startup.sh"]