https://github.com/hasferrr/ml-deployment-test
Deploying Machine Learning models with Python-Flask on Docker containers on Cloud Run and connecting them to React App via API.
https://github.com/hasferrr/ml-deployment-test
docker python react tensorflow
Last synced: 3 months ago
JSON representation
Deploying Machine Learning models with Python-Flask on Docker containers on Cloud Run and connecting them to React App via API.
- Host: GitHub
- URL: https://github.com/hasferrr/ml-deployment-test
- Owner: hasferrr
- Created: 2023-11-15T03:40:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-02T17:12:35.000Z (over 2 years ago)
- Last Synced: 2025-01-13T17:49:29.016Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 1.06 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Test ML-Backend-Frontend
## Development mode
Install dependency:
```bash
cd frontend
npm install
cd ../backend
pip install -r requirements.txt
```
Run:
```bash
npm run dev
flask run
```
## Production mode (Docker)
1. Change `Dockerfile`
1. Execute docker compose
```bash
cd frontend
docker compose -f docker-compose.yml up -d
cd ../backend
docker compose -f docker-compose.yml up -d
```
Stops and removes the containers, services, and associated volumes
```bash
docker compose -f docker-compose.yml down --volumes
```
## Production mode (deploy container image to Cloud Run)
1. Change project ID, region, image name, and other specification first on the `build.sh`, `cloudbuild.yaml`, and `Dockerfile`
1. Create Docker repository in the Artifact Registry
1. Execute the bash script
```bash
cd frontend
chmod +x build.sh
./build.sh
cd ../backend
chmod +x build.sh
./build.sh
```