diff --git a/dashboard-sqdc/Dockerfile b/dashboard-sqdc/Dockerfile index f27db3e..f5b45d7 100644 --- a/dashboard-sqdc/Dockerfile +++ b/dashboard-sqdc/Dockerfile @@ -8,8 +8,8 @@ WORKDIR /app # Copy package files COPY package*.json ./ -# Install dependencies -RUN npm ci --only=production +# Install all dependencies (including dev) needed for build +RUN npm ci # Copy source code COPY . . @@ -17,6 +17,9 @@ COPY . . # Build the application RUN npm run build +# Install only production dependencies for runtime +RUN npm ci --only=production + # Stage 2: Production image with Nginx FROM nginx:alpine @@ -43,4 +46,4 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost/ || exit 1 # Start both nginx and the API server -CMD sh -c "node /app/server.js & nginx -g 'daemon off;'" +CMD ["sh", "-c", "node /app/server.js & nginx -g 'daemon off;'"]