A FastAPI-based voice API application.
- Docker
- Docker Compose
Create a .env file in the root directory with the following variables:
APP_NAME=Spirit Voice API
HOST=0.0.0.0
PORT=8000
DEBUG=false- Build and start the application:
docker-compose up --build- Run in detached mode:
docker-compose up -d- View logs:
docker-compose logs -f- Stop the application:
docker-compose downdocker build -t spirit_voice_api .docker run -p 8000:8000 \
-e APP_NAME="Spirit Voice API" \
-e HOST=0.0.0.0 \
-e PORT=8000 \
-e DEBUG=false \
spirit_voice_apiThe docker-compose.yml includes a volume mount for hot-reloading during development. To enable auto-reload, update the CMD in the Dockerfile or docker-compose command to:
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadFor production:
- Remove the volume mount in docker-compose.yml
- Set appropriate environment variables
- Consider using a production-grade WSGI server configuration
- Install dependencies:
pip install -r requirements.txt-
Set environment variables: Create a
.envfile with the required variables. -
Run the application:
python -m uvicorn app.main:app --reload