-
-
Notifications
You must be signed in to change notification settings - Fork 51
Docker Support with updated documentation with Docker deployment guide #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Starting my review of the Docker support PR. I'll be analyzing the Dockerfile, CI workflow, compose files, and documentation updates. Will report back with findings shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall Assessment
This is a well-structured PR that adds comprehensive Docker support to the project. The implementation follows Docker best practices with multi-stage builds, proper layer caching, and multi-architecture support. The CI/CD pipeline is solid with automatic image publishing and cleanup.
Strengths:
- Clean multi-stage Dockerfile with proper dependency caching
- Thoughtful CI workflow with path filtering and artifact attestation
- Comprehensive documentation covering both compose and manual deployment
- Good separation between production (
docker-compose.yml) and development (docker-compose.dev.yml) configurations
Key Suggestions
-
key_usage.json mount — The compose file mounts this as a bind mount, which will create a directory if the file doesn't exist. Consider adding a note or handling this edge case.
-
Non-root user — The container runs as root, which works but is worth hardening for production.
-
Dynamic package name — Minor consistency improvement in the cleanup job.
Architectural Feedback
The approach is sound. Using GHCR for image hosting with automatic builds on push is the right choice for this project. The separation of concerns between the build workflow and compose files is clean.
Nitpicks and Minor Points
- The
.dockerignoreexcludes.github/which is correct, but note that workflow changes won't trigger rebuilds (the path filter correctly only watches the workflow file itself). - The documentation updates include many formatting fixes beyond Docker — this is fine but makes the diff larger than the feature scope.
Questions for the Author
- Should a
HEALTHCHECKinstruction be added to the Dockerfile for better container orchestration support? - Is there a reason the
docker-compose*.ymlfiles aren't included in the workflow path triggers? Changes to compose wouldn't require a rebuild, but just confirming this is intentional.
This review was generated by an AI assistant.
| # Mount logs directory for persistent logging | ||
| - ./logs:/app/logs | ||
| # Mount key_usage.json for usage statistics persistence | ||
| - ./key_usage.json:/app/key_usage.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential startup issue: Mounting key_usage.json directly will create a directory if the file does not exist on the host. Consider either:
- Adding a note to the Quick Start section about running
touch key_usage.jsonbeforedocker compose up, or - Using a bind mount with explicit file creation check
The manual Docker run documentation mentions touch key_usage.json, but this could easily be missed by users going straight to Docker Compose.
| FROM python:3.11-slim | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy installed packages from builder | ||
| COPY --from=builder /root/.local /root/.local | ||
|
|
||
| # Make sure scripts in .local are usable | ||
| ENV PATH=/root/.local/bin:$PATH | ||
|
|
||
| # Copy application code | ||
| COPY src/ ./src/ | ||
|
|
||
| # Create directories for logs and oauth credentials | ||
| RUN mkdir -p logs oauth_creds | ||
|
|
||
| # Expose the default port | ||
| EXPOSE 8000 | ||
|
|
||
| # Set environment variables | ||
| ENV PYTHONUNBUFFERED=1 | ||
| ENV PYTHONDONTWRITEBYTECODE=1 | ||
| ENV PYTHONPATH=/app/src | ||
|
|
||
| # Default command - runs proxy with the correct PYTHONPATH | ||
| CMD ["python", "src/proxy_app/main.py", "--port", "8000"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security consideration: The container runs as root user. While this works fine, running as a non-root user is a best practice for production deployments.
This is non-blocking — the current setup works, but consider adding a non-root user for security hardening in a future iteration:
RUN useradd --create-home appuser
USER appuser| - name: Delete old container images | ||
| uses: actions/delete-package-versions@v5 | ||
| with: | ||
| package-name: llm-api-key-proxy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor maintainability note: The package-name is hardcoded as llm-api-key-proxy, while IMAGE_NAME uses github.repository dynamically. If the repository is ever forked or renamed, this cleanup job would fail silently.
Consider using dynamic extraction:
| package-name: llm-api-key-proxy | |
| package-name: ${{ github.event.repository.name }} |
|
@mirrobot-agent. So, how ready is this? I assume this can be merged(after resolving). Resolve conflicts here, and provide an overview of what this PR does and accomplishes, and how. |
|
@Mirrowel, I'm checking the current state of this PR to assess its merge readiness. I'll:
Starting the analysis now. |
|
@Mirrowel, I've resolved the merge conflicts and the PR is now ready for merge! ✅ Conflicts ResolvedThe conflicts in
I merged both changes, preserving the clean table formatting from this PR while including the new quota variables from upstream. 📋 PR Overview: Docker SupportThis PR adds comprehensive Docker containerization to the LLM-API-Key-Proxy project. Here's what it accomplishes: What's Added
Key Features1. Multi-Stage Dockerfile
2. Docker Compose Files
3. CI/CD Workflow (
4. Documentation
📊 Merge Readiness
The PR is technically ready to merge. The 💡 Previous Review Suggestions (from my Jan 6 review)For future improvements, consider:
These are non-blocking quality improvements that can be addressed in a follow-up PR. This analysis and conflict resolution was performed by an AI assistant. |
|
@mirrobot-agent check this docker build against the existing build workflow. Logically, a docker build should closely mirror executable build workflow, publishing builds for different branches just like build does. |
|
@Mirrowel, I'm comparing the Docker build workflow against the existing executable build workflow. I'll analyze:
Starting the analysis now. |
|
@Mirrowel, I've completed my comparison of the Docker build workflow against the existing executable build workflow. 📊 Comparison Analysis
🔍 Key Findings1. Branch Restriction Mismatch
|
|
It got closed for some reason when i merged something else. Reopened. |
|
Would it be possible to add HTTPS/TLS support? I think it's essential considering macOS transport policy doesnt allow http connections anymore... This could be done via:
example on my fork: https://github.com/FammasMaz/LLM-API-Key-Proxy/blob/feature/docker-support/docker-compose.yml |
I will take any docker PR as long as it is explained to me decently so I can make a decision. This one seems almost perfect and needs readme changes, but idk much about docker hosting - only running on noob level. Just mostly mirror the build workflow so docker is made with it, same naming more or less. |
- Change container name from llm-api-proxy to llm-api-proxy-dev in docker-compose.dev.yml - Add new docker-compose.tls.yml file for TLS configuration
- Add instructions to create key_usage.json before running Docker Compose - Include warning about Docker creating directory instead of file if key_usage.json doesn't exist - Update both README.md and Deployment guide.md with the necessary steps
added it |
|
@Mirrowel this workflow run on this is similar to build.yml just 2 extra files
this workflow build docker images for linux amd64 and arm64
example The version tag format is DATE-TIME-SHORTSHA after all this users can normally follow readme instructions and use desired docker-compose file |
|
@SSinist3r I see, thanks. I see ports for oauth logging in are not routed. Is it even possible to use interactive log in in such a way? Other than that. @FammasMaz anything else to add? Not a docker expert here, so asking for an opinion. |
|
Personally, the base image I use is : Cheers |
Not using uv is a crime indeed |
|
Any ETA on this PR? |
I'll look into merging right now. Though, if docker stuff breaks i can't provide support for it - i don't use it or plan to. |
- Add `workflow_dispatch` trigger to `docker-build.yml` to allow manual workflow execution with a configurable git ref. - Upgrade `actions/checkout` version to v5 in `build.yml`.
This PR adds the docker support with updated documentation for docker deployment and it also auto build and push docker images to ghcr.io github registry.
Important
Adds Docker support with CI/CD for LLM-API-Key-Proxy, including Dockerfiles, GitHub Actions, and updated documentation for deployment and OAuth management.
Dockerfilefor building the application image.docker-compose.ymlanddocker-compose.dev.ymlfor production and development setups..env,oauth_creds,logs, andkey_usage.json..github/workflows/docker-build.ymlto automate Docker image build and push to GitHub Container Registry onmainanddevbranch pushes.README.mdandDeployment guide.mdwith Docker deployment instructions.This description was created by
for 0452066. You can customize this summary. It will automatically update as commits are pushed.