Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shaggyyy2002/demo-pipeline
Used Github Actions to deploy our Python App onto Ec2 instance using Docker Image
https://github.com/shaggyyy2002/demo-pipeline
cd ci docker docker-compose github-actions python
Last synced: 29 days ago
JSON representation
Used Github Actions to deploy our Python App onto Ec2 instance using Docker Image
- Host: GitHub
- URL: https://github.com/shaggyyy2002/demo-pipeline
- Owner: shaggyyy2002
- Created: 2023-10-19T07:30:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-19T12:31:31.000Z (over 1 year ago)
- Last Synced: 2024-11-06T23:15:31.019Z (3 months ago)
- Topics: cd, ci, docker, docker-compose, github-actions, python
- Language: Dockerfile
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python App Deployment using Github Actions
## Overview:
I have created a basic Python app, with task to deploy it using Github Actions for the DevOps Project## Installation Guide:
To start the app on your local machine make sure to have git, docker & docker-compose already installed.### Clone the Repo
```sh
git clone https://github.com/shaggyyy2002/demo-pipeline.git
```### Start app Using Docker
- Build Docker Image:
```sh
docker build -t python-app .
```
- Run Docker Image as Container:
```sh
docker run -d -p 5000:5000 --name pearlthoughts python-app
```### OR
### Start using Docker-Compose
- Make sure you're in the root folder and paste the command in your terminal
```sh
docker-compose up
```## CI-CD Pipeline
**CI Pipeline:**
- Our CI Pipeline helps us to build and push our Docker Image to our Personal Repository.
- It creates a push everytime we add something to our main branch.
- We have also setup our Docker Login credentials onto our Github Secrets.
- Once all the process is done it pushed our dockerimage to our `nitin03/python-app` repo on DockerHub with a `latest` tag.**CD Pipeline:**
- Once the CI pipeline is done only then our CD pipeline will start running because of the `workflow_run`.
- To run our docker image as a container we have setup our self hosted runner onto our Github Repo.
- The next steps our Pipeline will follow are
- Pull the docker-image from our DockerHub repo.
- Delete our old container running the same image if any.
- Once done it will start a new contaier using the latest Docker-Image from our DockerHub.## Post Deployment