Skip to content

Commit

Permalink
Update Dockerfile to use uv base image and optimize dependency instal…
Browse files Browse the repository at this point in the history
…lation

- Switch base image to `ghcr.io/astral-sh/uv:python3.12-bookworm-slim`
- Combine apt-get commands and clean up to reduce image size
- Replace Poetry with uv for dependency management and caching
  • Loading branch information
ogabrielluiz committed Sep 25, 2024
1 parent 6a3a588 commit d454a3d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docker/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
FROM python:3.12-bookworm
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
ENV TZ=UTC

WORKDIR /app

RUN apt update -y
RUN apt install \
RUN apt-get update && apt-get install -y \
build-essential \
curl \
npm \
-y
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY . /app

RUN pip install poetry
RUN poetry config virtualenvs.create false
RUN poetry install --no-interaction --no-ansi
# Install dependencies using uv
RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install --system -r requirements.txt

EXPOSE 7860
EXPOSE 3000
Expand Down

0 comments on commit d454a3d

Please sign in to comment.