Spaces:
Build error
Download docker_instructions.md from shahriarabir/Infinity_Doc: direct link, hf CLI and curl.
- Browser
- Download file 3.96 kB
-
https://huggingface.co/spaces/shahriarabir/Infinity_Doc/resolve/main/docker_instructions.md
- Command line
-
hf download hf://spaces/shahriarabir/Infinity_Doc/docker_instructions.md
-
curl -L -o docker_instructions.md https://huggingface.co/spaces/shahriarabir/Infinity_Doc/resolve/main/docker_instructions.md
A newer version of the Gradio SDK is available: 6.32.0
Infinity Doctor Docker Instructions
This document provides detailed instructions on how to build and run the Infinity Doctor application using Docker.
Prerequisites
- Install Docker Desktop for Windows from https://www.docker.com/products/docker-desktop
- Ensure Docker is running on your system
- API keys for Groq (and optionally ElevenLabs)
Setting Up Environment Variables
Create a
.envfile in your project directory:# Copy the example file Copy-Item .env.example .env # Edit the file with your preferred editor notepad .envAdd your API keys to the
.envfile:GROQ_API_KEY=your_groq_api_key_here ELEVENLABS_API_KEY=your_elevenlabs_api_key_here
Building and Running with Docker
Option 1: Using the PowerShell script (Recommended for Windows)
Open PowerShell and navigate to the project directory
Run the provided script:
.\run_docker.ps1This script will:
- Check for a
.envfile and create one if it doesn't exist - Create necessary directories for data persistence
- Build the Docker image
- Run the container with all required parameters
- Check for a
Option 2: Using Docker Compose
Run the application with Docker Compose:
docker-compose upThis will:
- Build the Docker image if it doesn't exist
- Run the container with mounted volumes for data persistence
- Inject environment variables from your
.envfile - Map port 7860 to your host machine
To stop the application:
docker-compose downTo rebuild the image and start fresh:
docker-compose up --build
Option 3: Using Docker commands directly
Build the Docker image:
docker build -t infinity-doctor .Run the Docker container with environment variables:
docker run --rm -p 7860:7860 --env-file .env -v ${PWD}/images:/app/images -v ${PWD}/audio_data:/app/audio_data infinity-doctor
Data Persistence
The Docker configuration is set up to persist data in two directories:
./images: For storing uploaded images./audio_data: For storing audio recordings and generated audio responses
These directories are mounted as volumes in the Docker container, so your data will persist between container restarts.
Accessing the Application
Once running, access the Infinity Doctor application at: http://localhost:7860
Notes
- The Docker container exposes port 7860, which is the default port for Gradio applications
- Images uploaded through the interface will be saved in the
imagesdirectory - Audio files are processed within the container
GPU Support (Optional)
If you have a compatible NVIDIA GPU and want to use it for faster processing:
Install NVIDIA Container Toolkit
Add the
--gpus allflag when running the container:docker run --rm --gpus all -p 7860:7860 --env-file .env -v ${PWD}/images:/app/images -v ${PWD}/audio_data:/app/audio_data infinity-doctorOr modify the docker-compose.yml file to add:
deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: [gpu]
Troubleshooting
If you encounter issues with audio devices, note that Docker containers do not have direct access to the host's microphone. Use the text input option or upload pre-recorded audio files.
If you get a "port already in use" error, change the port mapping in the docker run command:
docker run --rm -p 7861:7860 --env-file .env infinity-doctorThen access the application at http://localhost:7861
For permission errors with mounted volumes, ensure the user running Docker has write access to the directories.