Skip to content

Commit 535dc9b

Browse files
committed
Update Dockerfile to use UV
1 parent 1e8868b commit 535dc9b

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

Resources/docker/app/Dockerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@ ENV PYTHONUNBUFFERED=1
55
RUN mkdir /code
66
WORKDIR /code
77

8-
ADD requirements.txt /code/
8+
# Install UV
9+
RUN apk add --no-cache curl
10+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
11+
12+
# Copy dependency files
13+
ADD pyproject.toml uv.lock* /code/
14+
15+
# Install dependencies
916
RUN apk add --no-cache postgresql-libs libstdc++
1017
RUN apk add --no-cache --virtual .build-deps gcc g++ musl-dev \
1118
postgresql-dev binutils rust cargo && \
12-
python3 -m pip install -r requirements.txt --no-cache-dir
19+
/root/.local/bin/uv sync --frozen --no-dev
1320

1421
FROM python:3.13.7-alpine
1522

@@ -28,6 +35,6 @@ RUN addgroup -g 1000 -S pokeapi && \
2835
adduser -u 1000 -S pokeapi -G pokeapi
2936
USER pokeapi
3037

31-
CMD ["gunicorn", "config.wsgi:application", "-c", "gunicorn.conf.py"]
38+
CMD ["/root/.local/bin/uv", "run", "gunicorn", "config.wsgi:application", "-c", "gunicorn.conf.py"]
3239

3340
EXPOSE 80

0 commit comments

Comments
 (0)