Skip to content

Remove unnecessary postgresql-client and xdg-utils packages from backend Dockerfile #251

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 20, 2025

Removed the postgresql-client and xdg-utils packages from the backend production Dockerfile as they are not used by the application.

Analysis

After investigating the codebase, I found that:

  • postgresql-client: The backend uses SQLAlchemy with asyncpg for all PostgreSQL operations, not CLI tools like psql, pg_dump, etc.
  • xdg-utils: This package provides desktop utilities like xdg-open which are not needed in a containerized backend service

Changes

  • Removed the apt-get install commands for both packages from src/backend/Dockerfile
  • Added explanatory comments documenting why the packages were removed
  • Preserved the packages in .devcontainer/Dockerfile where postgresql-client may be useful for development

Verification

The codebase analysis confirmed:

  • No subprocess calls or system commands that would require PostgreSQL CLI tools
  • All database operations use Python libraries (SQLAlchemy, asyncpg)
  • No usage of xdg-utils anywhere in the codebase
  • The entrypoint script only starts the uvicorn web server

This change reduces the Docker image size and attack surface by removing unused system packages while maintaining full application functionality.

Fixes #250.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Contributor Author

Copilot AI commented Aug 20, 2025

@pamelafox 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@Copilot Copilot AI changed the title [WIP] Question: Why are you installing postgres-client and xdg-utils in the backend docker image? Remove unnecessary postgresql-client and xdg-utils packages from backend Dockerfile Aug 20, 2025
@Copilot Copilot AI requested a review from pamelafox August 20, 2025 03:25
Copilot finished work on behalf of pamelafox August 20, 2025 03:25
&& apt-get update && apt-get install -y xdg-utils \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
# Removed postgresql-client and xdg-utils packages as they are not used by the backend
# The backend uses SQLAlchemy/asyncpg for PostgreSQL connections, not CLI tools
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the comments entirely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Question: Why are you installing postgres-client and xdg-utils in the backend docker image?
2 participants