Bumps [qs](https://github.com/ljharb/qs) to 6.11.0 and updates ancestor dependencies [qs](https://github.com/ljharb/qs), [body-parser](https://github.com/expressjs/body-parser) and [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `qs` from 6.7.0 to 6.11.0 - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/qs/compare/v6.7.0...v6.11.0) Updates `body-parser` from 1.19.0 to 1.20.2 - [Release notes](https://github.com/expressjs/body-parser/releases) - [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md) - [Commits](https://github.com/expressjs/body-parser/compare/1.19.0...1.20.2) Updates `express` from 4.17.1 to 4.19.2 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.17.1...4.19.2) --- updated-dependencies: - dependency-name: qs dependency-type: indirect - dependency-name: body-parser dependency-type: direct:production - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
Snippet of backend(Node.js)DockerFile
You will find this DockerFile file in the root directory of the project.
FROM node:13.13.0-stretch-slim
#Argument that is passed from docer-compose.yaml file
ARG NODE_PORT
#Echo the argument to check passed argument loaded here correctly
RUN echo "Argument port is : $NODE_PORT"
# Create app directory
WORKDIR /usr/src/app
#COPY . .
COPY . .
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
RUN npm install
#In my case my app binds to port NODE_PORT so you'll use the EXPOSE instruction to have it mapped by the docker daemon:
EXPOSE ${NODE_PORT}
CMD npm run dev
Explanation of backend(Node.js) DockerFile
-
The first line tells Docker to use another Node image from the DockerHub. We’re using the official Docker image for Node.js and it’s version 10 image.
-
On second line we declare argument
NODE_PORTwhich we will pass it fromdocker-compose. -
On third line we log to check argument is successfully read
-
On fourth line we sets a working directory from where the app code will live inside the Docker container.
-
On fifth line, we are copying/bundling our code working directory into container working directory on line three.
-
On line seven, we run npm install for dependencies in container on line four.
-
On Line eight, we setup the port, that Docker will expose when the container is running. In our case it is the port which we define inside
.envfile, read it fromdocker-composethen passed as a argument to the (backend)DockerFile. -
And in last, we tell docker to execute our app inside the container by using node to run `npm run dev. It is the command which I registered in package.json in script section.