68 lines
1.2 KiB
Markdown
68 lines
1.2 KiB
Markdown
# Getting Started
|
|
|
|
## Prerequisites
|
|
|
|
- Docker
|
|
- Python 3.7+
|
|
|
|
## Installation
|
|
|
|
1. Clone the repository
|
|
2. Build the Docker image:
|
|
|
|
```bash
|
|
docker build -t test-score-predictor .
|
|
```
|
|
|
|
3. Run the container:
|
|
|
|
```bash
|
|
docker run -p 8000:8000 test-score-predictor
|
|
```
|
|
|
|
## Environment Variables
|
|
|
|
The application uses the following environment variables:
|
|
- `MODEL_PATH`: Path to the model file (default: `linear_regression_model.pkl`)
|
|
- `SCALER_PATH`: Path to the scaler file (default: `scaler.pkl`)
|
|
- `PORT`: Port to run the application on (default: `8000`)
|
|
|
|
These can be set in the `.env` file or passed as environment variables.
|
|
|
|
## Development
|
|
|
|
To set up a development environment:
|
|
|
|
1. Create a virtual environment:
|
|
|
|
```bash
|
|
python -m venv venv
|
|
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
```
|
|
|
|
2. Install dependencies:
|
|
|
|
```bash
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
3. Run the application:
|
|
|
|
```bash
|
|
uvicorn main:app --reload
|
|
```
|
|
|
|
The application will be available at http://localhost:8000.
|
|
|
|
## Testing
|
|
|
|
Run the tests using:
|
|
|
|
```bash
|
|
pytest test_api.py
|
|
```
|
|
|
|
## Deployment
|
|
|
|
The application includes a GitHub Actions workflow for CI/CD in the `.github/workflows/deploy.yml` file.
|