This guide outlines the steps to build, deploy, and automate your Flask and React application using Docker, GitHub Actions, and AWS.
1️⃣ Build Docker Images
- Build the Dockerfile for the Flask backend.
- Build the Dockerfile for the Nginx frontend.
- Build using Docker Compose.
git add .
git commit -m "flask-react app"
git push origin maindocker tag nginx-backend:1.0 jeremyhuegel/nginx-backend:1.0
docker push jeremyhuegel/nginx-backend:1.0
docker tag flask-backend:1.0 jeremyhuegel/flask-backend:1.0
docker push jeremyhuegel/flask-backend:1.0- Create a
main.tffile to provision an AWS EC2 instance. - Manually create an S3 bucket.
- Manually create a DynamoDB table.
- In the root directory, create a
.github/workflows/directory. - Add a
deploy-app.ymlfile. - Push the changes to trigger GitHub Actions:
git add . git commit -m "github actions workflow" git push origin main
- GitHub Actions will automatically start the deployment process.
💡 For any issues, check GitHub Actions logs and AWS console for troubleshooting.
