Skip to content

Commit

Permalink
container: drop gcc
Browse files Browse the repository at this point in the history
Wheels for uvloop are now available, so let's drop gcc from the
container and add uvloop to requirements.txt.

This greatly reduces the container image build time.
  • Loading branch information
stintel committed Oct 25, 2023
1 parent ff86dd9 commit 4c9ffe6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
10 changes: 1 addition & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,10 @@ WORKDIR /app

COPY requirements.txt .

# Install gcc temporarily until wheels for httptools on Python 3.12 are available
RUN apt-get update && apt-get install -y gcc libmagic1
RUN apt-get update && apt-get install -y libmagic1 && rm -rf /var/lib/apt/lists/*

RUN --mount=type=cache,target=/root/.cache pip install -r requirements.txt

# Install deps to build uvloop until wheels are released
RUN apt-get install -y automake git libtool-bin libuv1-dev make && rm -rf /var/lib/apt/lists/*

RUN --mount=type=cache,target=/root/.cache pip install setuptools

RUN --mount=type=cache,target=/root/.cache pip install 'uvloop@git+https://github.com/MagicStack/uvloop.git@9f82bd7'

COPY . .

EXPOSE 8501
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ typing_extensions==4.8.0
ujson==5.8.0
urllib3==2.0.6
uvicorn==0.23.2
uvloop==0.19.0
watchfiles==0.20.0
websockets==11.0.3

0 comments on commit 4c9ffe6

Please sign in to comment.