|
@@ -2,11 +2,14 @@ FROM node:18-alpine
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
+# Install curl for health check
|
|
|
+RUN apk add --no-cache curl
|
|
|
+
|
|
|
# Copy package files
|
|
|
COPY package*.json ./
|
|
|
|
|
|
# Install dependencies
|
|
|
-RUN npm ci --only=production
|
|
|
+RUN npm install --only=production
|
|
|
|
|
|
# Copy source code
|
|
|
COPY . .
|
|
@@ -20,11 +23,11 @@ RUN chown -R nodejs:nodejs /app
|
|
|
USER nodejs
|
|
|
|
|
|
# Expose port
|
|
|
-EXPOSE 5000
|
|
|
+EXPOSE 4000
|
|
|
|
|
|
# Health check
|
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
|
- CMD curl -f http://localhost:5000/health || exit 1
|
|
|
+ CMD curl -f http://localhost:4000/health || exit 1
|
|
|
|
|
|
# Start the application
|
|
|
CMD ["npm", "start"]
|