# Dockerfile example for Node ```bash # Step 1 # Use Node 8 as base image FROM node:8 # Step 2 # Create app directory (next steps will be executed relative to this directory) WORKDIR /usr/src/app # Step 3 # Copy source (skip files/folders listed in .dockerignore) COPY . . # Step 4 # Install node modules RUN npm install # Step 5 # Define available ports for host OS EXPOSE 9500 # Step 6 # Start application CMD ["npm", "start"] # Usage: # (1) Build image - docker build -t my-node-app . # (2) Run image - docker run -p 9600:9500 -d my-node-app ```