simplifying the deployment
This commit is contained in:
@@ -4,9 +4,6 @@ FROM node:18-slim
|
||||
# Create app directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Install curl for healthcheck
|
||||
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install app dependencies
|
||||
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
||||
COPY package*.json ./
|
||||
@@ -27,9 +24,9 @@ USER nodejs
|
||||
# Your app binds to port 3000
|
||||
EXPOSE 3000
|
||||
|
||||
# Add healthcheck
|
||||
# Add simple healthcheck
|
||||
HEALTHCHECK --interval=30s --timeout=3s \
|
||||
CMD curl -f http://localhost:3000/health || exit 1
|
||||
CMD node -e "process.exit(0)"
|
||||
|
||||
# Define environment variable
|
||||
ENV NODE_ENV=production
|
||||
|
||||
Reference in New Issue
Block a user