Skip to content

Commit b764c21

Browse files
committed
use uv in dockerfiles
1 parent 52b8a3a commit b764c21

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

src/templates/rpc/Dockerfile_rpc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
# Use an official Python runtime as the base image
2-
FROM python:3.11-slim
2+
FROM python:3.12-slim
33

44
# Install procps, which includes pgrep
55
RUN apt-get update && \
66
apt-get install -y procps openssh-client && \
77
rm -rf /var/lib/apt/lists/*
88

9+
# Install `uv` packge installer (https://github.com/astral-sh/uv)
10+
RUN pip install uv
11+
912
# Set the working directory in the container
1013
WORKDIR /root/warnet
1114

15+
# Get better caching by installing before copying code
16+
COPY requirements.txt .
17+
RUN uv pip install --system --no-cache -r requirements.txt
18+
1219
# Copy the source directory contents into the container
1320
COPY . /root/warnet
14-
RUN pip install .
21+
# Install Warnet scripts
22+
RUN uv pip install --system .
1523

1624
# Make port 9276 available to the world outside this container
1725
# Change the port if your server is running on a different port

src/templates/rpc/Dockerfile_rpc_dev

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# Use an official Python runtime as the base image
2-
FROM python:3.11-slim
2+
FROM python:3.12-slim
33

44
# Install procps, which includes pgrep
55
RUN apt-get update && \
66
apt-get install -y procps openssh-client && \
77
rm -rf /var/lib/apt/lists/*
88

9+
# Install `uv` packge installer (https://github.com/astral-sh/uv)
10+
RUN pip install uv
11+
912
# Set the working directory in the container
1013
WORKDIR /root/warnet
1114

src/templates/rpc/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ done
3131
if check_setup_toml; then
3232
echo "Installing package from ${SOURCE_DIR}..."
3333
cd ${SOURCE_DIR}
34-
pip install -e .
34+
uv pip install --system --no-cache -e .
3535
fi
3636

3737
# Execute the CMD from the Dockerfile

0 commit comments

Comments
 (0)