forked from eficode/copilot-microsoft-hackathon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
42 lines (25 loc) · 1.23 KB
/
Copy pathdockerfile
File metadata and controls
42 lines (25 loc) · 1.23 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Create a dockerfile with node image
# Create a directory to hold the application code inside the image, this will be the working directory for your application
# Set the working directory to /usr/src/app
# Copy package.json and package-lock.json to the working directory
# Install npm
# Copy the current directory contents into the container at /usr/src/app
# Make port 3000 available to the world outside this container
# Run Nodeserver.js when the container launches
# Write a docker comand to build the image and tag it as mynodeapp
# Use the official Node.js image from the Docker Hub
FROM node:14
# Create a directory to hold the application code inside the image, this will be the working directory for your application
WORKDIR /usr/src/app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install npm dependencies
RUN npm install
# Copy the current directory contents into the container at /usr/src/app
COPY . .
# Make port 4000 available to the world outside this container and route it to 3000
EXPOSE 3000:3000
# Run Nodeserver.js when the container launches
CMD ["node", "nodeserver.js"]
# Write a docker command to build the image and tag it as mynodeapp
# docker build -t mynodeapp .