Spaces:
Build error
Build error
Nicola Beghin commited on
Commit ·
1b023e3
1
Parent(s): 4102402
feat: add Docker configuration for containerized deployment
Browse files- Add .dockerignore to exclude unnecessary files from Docker builds
- Add Dockerfile to containerize Python application with health checks
- Add docker-compose.yml for easy local development and deployment of headroom proxy service
- .dockerignore +15 -0
- Dockerfile +8 -0
- docker-compose.yml +11 -0
.dockerignore
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.git
|
| 2 |
+
__pycache__
|
| 3 |
+
*.pyc
|
| 4 |
+
*.pyo
|
| 5 |
+
.pytest_cache
|
| 6 |
+
.coverage
|
| 7 |
+
.mypy_cache
|
| 8 |
+
.ruff_cache
|
| 9 |
+
tests/
|
| 10 |
+
docs/
|
| 11 |
+
CHANGELOG.md
|
| 12 |
+
LICENSE
|
| 13 |
+
NOTICE
|
| 14 |
+
.env
|
| 15 |
+
*.log
|
Dockerfile
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
| 3 |
+
COPY . /app
|
| 4 |
+
WORKDIR /app
|
| 5 |
+
RUN pip install -e .[proxy]
|
| 6 |
+
EXPOSE 8787
|
| 7 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD curl -f http://localhost:8787/health || exit 1
|
| 8 |
+
ENTRYPOINT ["headroom", "proxy"]
|
docker-compose.yml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
services:
|
| 2 |
+
headroom-proxy:
|
| 3 |
+
build: .
|
| 4 |
+
command: ["--host", "0.0.0.0"]
|
| 5 |
+
environment:
|
| 6 |
+
- HEADROOM_HOST=0.0.0.0
|
| 7 |
+
# if you want to use a custom OpenAI-compatible API endpoint,
|
| 8 |
+
# uncomment and set the following line with the desired URL
|
| 9 |
+
# - OPENAI_TARGET_API_URL=https://api.x.ai
|
| 10 |
+
ports:
|
| 11 |
+
- "8787:8787"
|