FROM node:18-slim # Create app directory WORKDIR /app # Install dependencies first to leverage Docker cache COPY package.json package-lock.json ./ RUN npm ci # Copy the rest of the source code COPY . . # Build project from source RUN npm run build # Expose the port used by the dev server (BrowserSync) EXPOSE 3000 # Start the app (builds again if needed, but should be fast after first run) CMD ["npm", "start"]
node_modules dist build coverage .vscode .idea *.log .env .env.*
Smoke [PASS]: test -f /app/dist/index.html || test -f /app/server.js Smoke [PASS]: node -v