Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated README.md at /react-express-mongodb /backend/ #405

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Thoshinny-cyber
Copy link

Enhanced Dockerfile snippet and it's explanation in README.md

The Dockerfile snippet in the README.md file required adjustments to align it more closely with the actual Dockerfiles in both the Backend and Frontend directories. I've made few improvements to ensure clarity and accuracy.

Original Snippet in Repository:

FROM node:13.13.0-stretch-slim
# Argument passed from docker-compose.yaml file
ARG NODE_PORT
# Echo the argument to check if it's loaded correctly RUN echo "Argument port is: $NODE_PORT"
# Create app directory
WORKDIR /usr/src/app
# Copy entire content
COPY . .
# Install app dependencies
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

Modified Snippet:

FROM node:13.13.0-stretch-slim
#Argument that is passed from docker-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 dependency definitions
COPY package.json /usr/src/app
# Install app dependencies
RUN npm install
# Get all the code needed to run the app
COPY . /usr/src/app
#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

These changes ensure better understanding and readability.

I've updated the README.md explanation for the updated snippet.

Enhanced Dockerfile snippet in README.md

The Dockerfile snippet in the README.md file required adjustments to align it more closely with the actual Dockerfiles in both the Backend and Frontend directories. I've made a few improvements to ensure clarity and accuracy.

Original Snippet in Repository:

FROM node:13.13.0-stretch-slim
# Argument passed from docker-compose.yaml file
ARG NODE_PORT
# Echo the argument to check if it's loaded correctly
RUN echo "Argument port is: $NODE_PORT"
# Create app directory
WORKDIR /usr/src/app
# Copy entire content
COPY . .
# Install app dependencies
RUN npm install
# My app binds to port NODE_PORT; use the EXPOSE instruction for Docker daemon mapping:
EXPOSE ${NODE_PORT}
CMD npm run dev

Modified Snippet:

FROM node:13.13.0-stretch-slim
# Argument passed from docker-compose.yaml file
ARG NODE_PORT
# Echo the argument to check if it's loaded correctly
RUN echo "Argument port is: $NODE_PORT"
# Create app directory
WORKDIR /usr/src/app
# Copy dependency definitions first for better Docker caching
COPY package.json /usr/src/app
# Install app dependencies
RUN npm install
# Copy the entire application code
COPY . /usr/src/app
# My app binds to port NODE_PORT; use the EXPOSE instruction for Docker daemon mapping:
EXPOSE ${NODE_PORT}
CMD npm run dev


These changes ensure consistency and readability.

Signed-off-by: Thoshinny B <69354714+Thoshinny-cyber@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants