Skip to content

Commit

Permalink
Use uv to install packages
Browse files Browse the repository at this point in the history
  • Loading branch information
perfectly-preserved-pie authored Feb 22, 2024
1 parent 4740a60 commit 40b2936
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 . ./

Expand All @@ -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"]
CMD ["gunicorn", "-b", "0.0.0.0:80", "--workers=4", "--preload", "app:server"]

0 comments on commit 40b2936

Please sign in to comment.