mirror of
https://github.com/pacnpal/simpleguardhome.git
synced 2025-12-20 04:21:13 -05:00
feat(docker): set up Python virtual environment and update dependencies in Dockerfile and CI workflow
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user