expressjs-express
SUCCESS
4m 04s
History Source
SummaryIterations1Transcript5Dockerfile
Dockerfile22 lines · 471 chars
FROM node:18-slim

# Create app directory
WORKDIR /usr/src/app

# Default to production; will install only dependencies
ENV NODE_ENV=production

# Install dependencies first to leverage Docker cache
COPY package.json ./

RUN npm install --omit=dev

# Copy the rest of the repository
COPY . .

# Expose the port the example app will listen on
EXPOSE 3000

# Run the hello-world example by default to provide a runnable server
CMD ["node", "examples/hello-world/index.js"]