forked from microsoft/CopilotHackathon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
27 lines (20 loc) · 807 Bytes
/
Copy pathdockerfile
File metadata and controls
27 lines (20 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Use an official Node runtime as a parent image
FROM node:18-alpine
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# We copy package.json and package-lock.json first to leverage Docker cache
COPY package*.json ./
# Install dependencies (use npm ci when package-lock.json is present for reproducible builds)
RUN if [ -f package-lock.json ]; then npm ci --only=production; else npm install --only=production; fi
# Bundle app source
COPY . .
# Expose the port the app runs on
EXPOSE 3000
# Default command
CMD ["node", "nodeserver.js"]
# Build command (run from the directory containing this Dockerfile):
# PowerShell example:
# docker build -t mynodeapp -f .\dockerfile .
# Run example (maps container port 3000 to host port 3000):
# docker run --rm -p 3000:3000 mynodeapp