diff --git a/Dockerfile b/Dockerfile index a59a2ae..5e532af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,24 +4,19 @@ WORKDIR /app COPY package*.json ./ RUN npm ci COPY . . +# Ensure CSS variables are present +RUN mkdir -p public/styles +RUN cp -r styles/* public/styles/ || true RUN npm run build FROM node:20-alpine AS production WORKDIR /app -ENV NODE_ENV=production - -# Kopiere package.json und package-lock.json für Produktions-Abhängigkeiten -COPY package*.json ./ -# Installiere nur Produktions-Abhängigkeiten -RUN npm ci --only=production && npm cache clean --force - -# Kopiere das gebaute Projekt +RUN npm install -g serve COPY --from=build /app/dist ./dist -# install minimal deps to run node if needed (alpine already has node) EXPOSE 3000 -CMD ["node", "./dist/server/entry.mjs"] +CMD ["serve", "-s", "dist", "-l", "3000"] -HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ +HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD wget -qO- http://localhost:3000/ || exit 1 \ No newline at end of file