Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Docker support for disability-max-ratings-api
This PR adds Docker support to run the disability-max-ratings-api service in a containerized environment. - Added `Dockerfile` with Python 3.12.3 and Poetry setup - Added `docker-compose.yml` for local development - Added healthcheck to monitor service availability - Fixed Poetry configuration in `pyproject.toml` - Added required `authors` field - Removed unsupported `package-mode` field 1. Build and start the container: ```bash docker compose up --build ``` 2. Test the API health/docs: ```bash curl http://localhost:8130/docs ``` 3. Test the API endpoint with a sample request: ```bash curl -X POST http://localhost:8130/disability-max-ratings/ \ -H "Content-Type: application/json" \ -d '{"diagnostic_codes": [6260]}' ``` Expected response: ```json { "ratings": [ { "diagnostic_code": 6260, "max_rating": 10 } ] } ``` 4. Monitor container health: ```bash docker compose ps ``` - Uses Python slim base image to minimize container size - Installs only production dependencies with `--only main` - Configures Poetry to run without virtual environments in container - Exposes port 8130 for API access - Includes curl for healthcheck functionality - Mounts local directory for development convenience - Runs with `no-new-privileges` security option - Cleans up apt cache to reduce image size - Uses official Python base image ```
- Loading branch information