Skip to content
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

Make API images single-binary #288

Open
shaldengeki opened this issue Jul 25, 2024 · 0 comments
Open

Make API images single-binary #288

shaldengeki opened this issue Jul 25, 2024 · 0 comments
Labels
python Pull requests that update Python code

Comments

@shaldengeki
Copy link
Owner

Out of convenience, when creating the API images, we bundle three py_binary target layers together. I think this doubled the size of our images (from ~180 to ~360MB), because we're bundling multiple Python environments.

Instead, we should restructure the image rule to take a single py_library for the API as a parameter. Then create a single py_binary, where:

  • We run wait_for_postgres
  • We pass the application to run on the CLI as the first argument (CMD)
  • We parse the input, and either run migrations, or start the API

That should reduce API container image sizes considerably (hopefully).

@shaldengeki shaldengeki added the python Pull requests that update Python code label Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

1 participant