-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile
24 lines (18 loc) · 926 Bytes
/
dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Use the official Node.js image as the base image, specifically the "slim" variant,
#which is a smaller version of the image.
FROM node:slim
# Set the environment variable NODE_ENV to "development".
#This can be used by your application to determine the environment it's running in.
ENV NODE_ENV development
# Set the working directory in the container to /express-docker.
# All subsequent commands will be run in this directory.
WORKDIR /express-docker
# Copy all files from the current directory on the host machine to the working directory in the container.
COPY . .
# Run the command "npm install" to install all dependencies listed in the package.json file.
RUN npm install
# Inform Docker that the container will listen on port 3000 at runtime.
EXPOSE 3000
# Specify the command to run when the container starts.
# Here, it will run "node index.js" to start your Node.js application.
CMD [ "node", "index.js" ]