expressjs-express
SUCCESS
20m 11s
History Source
SummaryIterations2Transcript33Dockerfile
Dockerfile25 lines · 573 chars
FROM node:slim

# Create app directory
WORKDIR /usr/src/app

# Install dependencies first for caching
COPY package*.json ./

RUN npm install

# Copy app source
COPY . .

# Install curl for healthcheck
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*

# Expose app port (hello-world uses 3000)
EXPOSE 3000

# Healthcheck to ensure app is running
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD curl -f http://localhost:3000/ || exit 1

# Start the example server by default
CMD ["node", "examples/hello-world/index.js"]