Dockerfile nodejs

This commit is contained in:
22107988t 2023-09-25 13:40:22 +02:00
parent 9e31d491b7
commit 4a3840b4c9

20
app/Dockerfile Normal file
View File

@ -0,0 +1,20 @@
# pull the Node.js Docker image
FROM node:alpine
# create the directory inside the container
WORKDIR /usr/src/app
# copy the package.json files from local machine to the workdir in container
COPY package*.json ./
# run npm install in our local machine
RUN npm install
# copy the generated modules and all other files to the container
COPY . .
# our app is running on port 5000 within the container, so need to expose it
EXPOSE 5000
# the command that starts our app
CMD ["node", "index.js"]