From 40b293649715d56de92a7ef5c1588e6ef92ab73f Mon Sep 17 00:00:00 2001 From: Sahib B Date: Wed, 21 Feb 2024 22:08:13 -0800 Subject: [PATCH] Use uv to install packages --- Dockerfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4591332..741f6ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,16 @@ FROM python:3.11-slim COPY requirements.txt . -RUN pip install --no-cache-dir --upgrade -r requirements.txt +# Install curl +RUN apt-get update && apt-get install -y curl + +# Using uv to install packages because it's fast as fuck boiiii +# https://www.youtube.com/watch?v=6E7ZGCfruaw +# https://ryxcommar.com/2024/02/15/how-to-cut-your-python-docker-builds-in-half-with-uv/ +ENV VIRTUAL_ENV=/usr/local +ADD --chmod=655 https://astral.sh/uv/install.sh /install.sh +RUN /install.sh && rm /install.sh +RUN /root/.cargo/bin/uv pip install --no-cache -r requirements.txt COPY . ./ @@ -11,4 +20,4 @@ COPY . ./ # Set the number of workers to 4. # Preload the app to avoid the overhead of loading the app for each worker. See https://www.joelsleppy.com/blog/gunicorn-application-preloading/ # Set the app to be the server variable in app.py. -CMD ["gunicorn", "-b", "0.0.0.0:80", "--workers=4", "--preload", "app:server"] \ No newline at end of file +CMD ["gunicorn", "-b", "0.0.0.0:80", "--workers=4", "--preload", "app:server"]