This project provides infrastructure for deploying a machine learning model using Flask, Docker, and Celery, tailored for both Mac and Windows users.
0xGP_Deployment/
├── models/
│ ├── random_forest_model.pkl
│ ├── tfidf_vectorizer.pkl
│ └── scaler.pkl
├── app/
│ └── application.py
├── templates/
│ ├── compare.html
│ ├── index.html
│ ├── missing.html
│ ├── predict.html
│ └── result.html
├── .dockerignore
├── .gitignore
├── Dockerfile
├── gunicorn_config.py
├── gunicorn.sh
├── Procfile
├── README.md
├── requirements-dev.in
└── requirements.txt
- Python 3
- Docker
- Redis
- Flask
- Celery
- Postman (for API testing)
-
Generate Lock File:
pip-compile --generate-hashes --output-file=requirements-lock.txt requirements.in
-
Build Docker Image:
docker build -t 0xnrous-server:latest . docker run -p 5000:5000 0xnrous-server:latest
-
Essential Commands for Last Session:
python your_flask_app.py celery -A your_flask_app.celery worker --loglevel=info redis-server
-
Install CMake:
cmake --version # Install if not found Invoke-WebRequest -Uri "https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-windows-x86_64.msi" -OutFile "cmake-3.26.4-windows-x86_64.msi" # Open 0xGP Deployment and install CMake using GUI
-
Setup Environment Paths:
$env:Path += ";C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin" $env:Path += ";C:\Program Files\CMake\bin"
-
Build Project:
mkdir build cd build cmake .. cmake --build . --config Release cmake --version
-
Setup Virtual Environment and Install Requirements:
python -m venv .venv .venv\Scripts\activate python -m pip install --upgrade pip pip install -r requirements.txt
-
Install Requirements:
pip install -r requirements.txt
-
Run Application:
python application.py
-
Access the Application: Open your browser and navigate to http://localhost:5000.
Build and Run Docker Image:
docker build -t 0xnrous-server:latest .
docker run -p 5000:5000 0xnrous-server:latest
For detailed API documentation, please refer to the Postman collection: 0xGP API Documentation.
This project is licensed under the MIT License. See the LICENSE file for details.