feat(docker): set up Python virtual environment and update dependencies in Dockerfile and CI workflow

This commit is contained in:
pacnpal
2025-01-28 19:08:57 -05:00
parent b4f8ed336d
commit ac4df6a326
2 changed files with 22 additions and 2 deletions

View File

@@ -6,14 +6,22 @@ WORKDIR /app
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc && \
apt-get install -y --no-install-recommends gcc python3-venv && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Create and activate virtual environment
ENV VIRTUAL_ENV=/opt/venv
RUN python -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Upgrade pip and essential tools
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
# Install Python dependencies in venv
RUN pip install --no-cache-dir -r requirements.txt
# Copy the source code