CI-CD Pipeline using Jenkins to deploy a News App on Docker Container over AWS Instance

October 29, 2023

📖 1 mins
Preview

Hello connections, In this article I'll let you how I created a CI/CD pipeline to deploy my simple News Application (created using React JS as frontend and Fast-API as backend) over Docker Host running in the AWS Cloud.

Well, I was merely getting into the field of web development, so this idea of integrating my DevOps skills with the development came into my mind.

After completing my code of backend and frontend, I created the Dockerfiles for backend and frontend i.e. for Fast-API and React JS.

#Dockerfile for React JS

FROM node:14.9.0 AS build-step


WORKDIR /build
COPY package.json package-lock.json ./
RUN npm install


COPY . .
RUN npm run build


FROM nginx:1.18-alpine
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=build-step /build/build /frontend/build

#Dockerfile for Fast API

FROM python:3.9


WORKDIR /code


COPY requirements.txt /code/requirements.txt


RUN pip install --no-cache-dir --upgrade -r requirements.txt


COPY . /code


CMD ["python","app.py"]

Preparing the production environment

Now coming into the deployment part, as you can see that there two EC2 Instances running

  • Jenkins Server
  • Docker Host

amazon stateamazon state

Hope you had a brief idea about this complete project. For any doubts or questions please feel free to DM me.

Soon I'll be writing a Jenkinsfile for this process to run a pipeline instead of making a freestyle project for the same.

Nếu cảm thấy hay, Lưu và chia sẻ
Nếu bạn muốn thảo luận, hãy để lại bình luận nhé 👇

Comments


© 2025 Ngoc Danh. All rights reserved.

</> with 💖 by Ngoc Danh

v1.0.0