Skip to content

Commit 7e74cdc

Browse files
authored
use UV to install dependencies, install to virtual environment (#226)
1 parent 9cbc00d commit 7e74cdc

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

docker/python/Dockerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@ FROM python:3.12-bookworm
33
RUN apt-get update \
44
&& apt-get install -y python3-dev default-libmysqlclient-dev build-essential pkg-config
55

6-
COPY . /python-api
6+
ENV VIRTUAL_ENV=/opt/venv
7+
RUN python -m venv $VIRTUAL_ENV
8+
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
9+
10+
RUN python -m pip install uv
11+
712
WORKDIR /python-api
13+
COPY pyproject.toml .
14+
15+
RUN uv pip install -e ".[dev]"
16+
COPY . /python-api
817

9-
RUN python -m pip install --upgrade pip
10-
RUN python -m pip install -e ".[dev]"
1118

1219
EXPOSE 8000
1320
ENTRYPOINT ["python", "src/main.py"]

0 commit comments

Comments
 (0)