Dockerise Node Application and deploy it to ECR

Architecture Diagram :

For Detailed Explaination Please Go through the Session which are Uploaded on LMS

Dockerfile for Node Application :

FROM node:14
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "run", "start"]

Command to create Docker Image

docker build -t <image_name> .

Commands to push to ECR Repository:

  • In ECR repository you will find the view Push command button click on that to get your push commands. Run them to get the Image into ECR repository.

Run Jest and Hardhat test with Dockerfile

FROM node:14
WORKDIR /app
COPY src/package*.json ./
RUN npm install
COPY . .
RUN npx jest --config=test/jest.config.js
RUN npx hardhat test --config=test/hardat.config.js
EXPOSE 3000
CMD ["npm", "run", "start"]

Leave a Comment

MFH IT Solutions (Regd No -LIN : AP-03-46-003-03147775)

Consultation & project support organization.

Contact

MFH IT Solutions (Regd)
NAD Kotha Road, Opp Bashyam School, Butchurajupalem, Jaya Prakash Nagar Visakhapatnam, Andhra Pradesh – 530027