Skip to content

Commit

Permalink
Revert "Use Chainguard Python image."
Browse files Browse the repository at this point in the history
This reverts commit b903a80.
  • Loading branch information
perfectly-preserved-pie committed Sep 3, 2024
1 parent b903a80 commit 8e417fa
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
FROM cgr.dev/chainguard/python:latest-dev
FROM python:3.11-slim

COPY requirements.txt .

# Switch to root user to install packages
USER root

# Install curl
RUN apk update && apk add --no-cache 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://docs.astral.sh/uv/guides/integration/docker/
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
RUN uv pip install --system -r requirements.txt
# https://ryxcommar.com/2024/02/15/how-to-cut-your-python-docker-builds-in-half-with-uv/
ADD --chmod=655 https://astral.sh/uv/install.sh /install.sh
RUN /install.sh && rm /install.sh
RUN /root/.cargo/bin/uv pip install --system --no-cache -r requirements.txt

COPY . ./

Expand All @@ -21,4 +19,4 @@ COPY . ./
# Set the number of workers to 10.
# 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 ["/usr/bin/gunicorn", "-b", "0.0.0.0:80", "-k", "gevent", "--workers=10", "--preload", "app:server"]
CMD ["gunicorn", "-b", "0.0.0.0:80", "-k", "gevent", "--workers=10", "--preload", "app:server"]

0 comments on commit 8e417fa

Please sign in to comment.