diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..3c21a6635 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +.git +__pycache__ +*.pyc +*.pyo +.pytest_cache +.coverage +.mypy_cache +.ruff_cache +tests/ +docs/ +CHANGELOG.md +LICENSE +NOTICE +.env +*.log \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..348188597 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.11-slim +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* +COPY . /app +WORKDIR /app +RUN pip install -e .[proxy] +EXPOSE 8787 +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD curl -f http://localhost:8787/health || exit 1 +ENTRYPOINT ["headroom", "proxy"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..8ccd16e0b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +services: + headroom-proxy: + build: . + command: ["--host", "0.0.0.0"] + environment: + - HEADROOM_HOST=0.0.0.0 + # if you want to use a custom OpenAI-compatible API endpoint, + # uncomment and set the following line with the desired URL + # - OPENAI_TARGET_API_URL=https://api.x.ai + ports: + - "8787:8787" \ No newline at end of file