From ce508d32b581924c228a99495d4e0848c9d57cc4 Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Sun, 18 Jan 2026 16:06:01 +0100 Subject: [PATCH] Fix Dockerfile to properly expose container service - Install all dependencies with 'npm ci' instead of production-only - Install 'serve' package globally in container - Use direct serve command with proper host binding (0.0.0.0) - Fix container service accessibility for production deployment --- Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index fe21054..6bebe8e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,8 @@ WORKDIR /app # Copy package files COPY package*.json ./ -# Install dependencies -RUN npm ci --only=production +# Install dependencies (including serve for production) +RUN npm ci # Copy application source COPY . . @@ -16,8 +16,11 @@ COPY . . # Build the application RUN npm run build +# Install serve globally for production serving +RUN npm install -g serve + # Expose port 3000 EXPOSE 3000 -# Start the application -CMD ["npm", "run", "serve"] \ No newline at end of file +# Start the application using serve directly +CMD ["serve", "-s", "build", "-l", "3000", "--host", "0.0.0.0"] \ No newline at end of file