FROM node:18-slim # Create app directory WORKDIR /usr/src/app # Install dependencies first to leverage Docker cache COPY package.json ./ RUN npm install # 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"]
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"]
node_modules .git .github test coverage dist History.md Readme.md README.md *.log *.tmp
.dockerignore
Smoke [PASS]: test -f /usr/src/app/examples/hello-world/index.js Smoke [PASS]: test -f /usr/src/app/package.json Smoke [PASS]: node -v