{"id":20655398,"url":"https://github.com/bhimrazy/litserve-meets-traefik","last_synced_at":"2025-09-26T22:30:45.606Z","repository":{"id":245080225,"uuid":"817157737","full_name":"bhimrazy/litserve-meets-traefik","owner":"bhimrazy","description":"Deploy LitServe API with Traefik Using Docker Compose","archived":false,"fork":false,"pushed_at":"2024-09-18T11:07:47.000Z","size":31,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-16T18:11:38.819Z","etag":null,"topics":["ai","deployment","docker","docker-compose","inference","litserve","model","traefik"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bhimrazy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-19T06:24:13.000Z","updated_at":"2024-11-06T08:22:56.000Z","dependencies_parsed_at":"2024-06-19T17:12:07.709Z","dependency_job_id":"f728f150-65b4-4d02-aaa9-18648904000f","html_url":"https://github.com/bhimrazy/litserve-meets-traefik","commit_stats":null,"previous_names":["bhimrazy/litserve-meets-traefik"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhimrazy%2Flitserve-meets-traefik","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhimrazy%2Flitserve-meets-traefik/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhimrazy%2Flitserve-meets-traefik/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhimrazy%2Flitserve-meets-traefik/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhimrazy","download_url":"https://codeload.github.com/bhimrazy/litserve-meets-traefik/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234353041,"owners_count":18818748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","deployment","docker","docker-compose","inference","litserve","model","traefik"],"created_at":"2024-11-16T18:10:50.370Z","updated_at":"2025-09-26T22:30:45.274Z","avatar_url":"https://github.com/bhimrazy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eLitServe meets Traefik\u003c/h1\u003e\n  \u003cp\u003eDeploy LitServe API with Traefik Using Docker Compose\u003c/p\u003e\n  \u003cimg src=\"https://github.com/bhimrazy/litserve-meets-traefik/assets/46085301/c749d77e-3a7a-4101-ad27-1ed2252802c8\" alt=\"LitServe meets Traefik\" width=\"640\" height=\"360\"\u003e\n   \u003cbr/\u003e\n   \u003cbr/\u003e\n\u003c/div\u003e\n\n[LitServe](https://github.com/Lightning-AI/LitServe) is a high-throughput serving engine for deploying AI models at scale, while Traefik is a modern HTTP reverse proxy and load balancer that simplifies microservices deployment.\n\n## Table of Contents\n\n- [Run Locally](#run-locally)\n  - [Direct Python Execution](#direct-python-execution)\n  - [Using Docker Compose](#using-docker-compose)\n- [Deploy on AWS or Other Servers](#deploy-on-aws-or-other-servers)\n  - [Step-by-Step Deployment](#step-by-step-deployment)\n- [Configuration](#configuration)\n  - [.env Configuration](#env-configuration)\n  - [Generating Traefik Dashboard Password](#generating-traefik-dashboard-password)\n- [Accessing Services](#accessing-services)\n  - [Local Deployment](#local-deployment)\n  - [Production Deployment](#production-deployment)\n- [Additional Notes](#additional-notes)\n\n## Run Locally\n\n### Direct Python Execution\n\n```bash\ngit clone https://github.com/bhimrazy/litserve-meets-traefik.git\ncd litserve-meets-traefik\n\n# Install dependencies\npython3 -m venv venv \u0026\u0026 source venv/bin/activate\npip install -r requirements.txt\n\n# Start the server\npython server.py\n```\n\nCheck the server at http://localhost:8000.\n\n### Using Docker Compose\n\n```bash\n# Start the services\ndocker-compose up  # or docker-compose up -d to run in detached mode\n```\n\nCheck the server at http://litapi.localhost.\n\n## Deploy on AWS or Other Servers\n\n### Step-by-Step Deployment\n\n1. **Create a new EC2 instance and install Docker and Docker Compose:**\n\n   ```bash\n   sudo apt-get update\n   sudo apt-get install docker.io\n   sudo apt-get install docker-compose\n\n   # Check Docker status\n   sudo systemctl status docker\n   ```\n\n2. **Clone the repo \u0026 Set Up Environment Variables:**\n\n   - Clone the repository and navigate to the project directory.\n\n     ```bash\n       git clone https://github.com/bhimrazy/litserve-meets-traefik.git\n       cd litserve-meets-traefik\n     ```\n\n   - Create `.env` from `.env.example` and customize with your values.\n\n     ```bash\n     cp .env.example .env\n     ```\n\n3. **Generate Traefik Dashboard Password:**\n\n   - Install `apache2-utils` and generate a password for the Traefik dashboard.\n\n     ```bash\n     sudo apt install apache2-utils\n     htpasswd -nbB yourusername yourpassword\n     ```\n\n   - Add the generated password to `.env`.\n\n4. **Start the Services:**\n   use `docker-compose.prod.yml` to start the services in production mode.\n\n   ```bash\n   sudo docker-compose -f docker-compose.prod.yml up -d\n   ```\n\nCheck the API server at `API_DOMAIN` as configured in `.env`, and access the Traefik dashboard at `TRAEFIK_DOMAIN` as specified in `.env`.\n\n## Configuration\n\n### .env Configuration\n\nEnsure that `.env` contains the following configuration:\n\n```plaintext\nAPI_DOMAIN=your-api-domain.com # make sure to update your DNS records\nTRAEFIK_DOMAIN=your-traefik-dashboard-domain.com # make sure to update your DNS records\nTRAEFIK_USER=\nTRAEFIK_PASSWORD=\nEMAIL=\n# Add other necessary environment variables\n```\n\n### Generating Traefik Dashboard Password\n\nGenerate a password for the Traefik dashboard using `htpasswd` and update `.env`:\n\n```bash\nhtpasswd -nbB yourusername yourpassword\n```\n\n## Accessing Services\n\n### Local Deployment\n\n- LitServe API: http://litapi.localhost\n- Traefik Dashboard: http://traefik.localhost\n\n### Production Deployment\n\n- LitServe API: httsp://your-api-domain.com\n- Traefik Dashboard: https://your-traefik-dashboard-domain.com\n\n## Additional Notes\n\n- Ensure proper DNS configuration for domain-based access in production.\n- Monitor Traefik logs (`docker-compose logs -f traefik`) for troubleshooting and monitoring.\n- Customize `docker-compose.prod.yml` and `.env` according to your specific deployment requirements.\n\n## References\n\n- [LitServe](https://github.com/Lightning-AI/LitServe)\n- [Traefik Docker Compose Configuration](https://doc.traefik.io/traefik/user-guides/docker-compose/acme-tls/)\n- [FastAPI in Containers - Docker](https://fastapi.tiangolo.com/deployment/docker/)\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n## Authors\n\n- [Bhimraj Yadav](https://github.com/bhimrazy)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhimrazy%2Flitserve-meets-traefik","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhimrazy%2Flitserve-meets-traefik","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhimrazy%2Flitserve-meets-traefik/lists"}