From 599ac49a765446c3cf6594006b59af5049f03efe Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Sun, 19 Apr 2026 21:02:51 +0200 Subject: [PATCH] Refactor Dockerfile and entrypoint script for improved structure and consistency --- Dockerfile | 19 ++++++++++--------- entrypoint.sh | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index a4606e0..f345109 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,30 @@ FROM node:24-trixie-slim AS build -WORKDIR /app-new +WORKDIR /app COPY app-new/backend/package*.json backend/ COPY app-new/frontend/package*.json frontend/ -RUN cd backend && npm install -RUN cd frontend && npm install +RUN cd backend && npm ci +RUN cd frontend && npm ci COPY app-new . RUN cd backend && npm run build RUN cd frontend && npm run build +RUN cd backend && npm prune --omit=dev FROM node:24-trixie-slim AS runtime -WORKDIR /app-new +WORKDIR /app ENV NODE_ENV=production ENV PORT=3000 -COPY app-new/backend/package*.json ./ -RUN npm ci --omit=dev +COPY --from=build /app/dist dist +COPY --from=build /app/templates templates +COPY --from=build /app/templates.json templates.json +COPY --from=build /app/backend/node_modules dist/backend/node_modules -COPY --from=build /app-new/dist dist -COPY --from=build /app-new/templates templates -COPY --from=build /app-new/templates.json templates.json +WORKDIR /app COPY entrypoint.sh entrypoint.sh RUN chmod +x entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh index 7e44988..81059a3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ #!/usr/bin/env sh set -eu -exec node /app-new/dist/backend/server.js +exec node /app/dist/backend/server.js