feat(docker): update Dockerfile for improved package installation and add pyproject.toml

This commit is contained in:
pacnpal
2025-01-28 21:45:10 -05:00
parent b25fe5cb2b
commit 57539fa56e
2 changed files with 14 additions and 7 deletions

View File

@@ -14,7 +14,7 @@ RUN apt-get update && \
python3-pip \ python3-pip \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel && python3 -m pip install --no-cache-dir --upgrade "pip>=21.3" setuptools wheel
# Add architecture-specific compiler flags if needed # Add architecture-specific compiler flags if needed
ENV ARCHFLAGS="" ENV ARCHFLAGS=""
@@ -24,7 +24,7 @@ RUN mkdir -p /app/src/simpleguardhome && \
chmod -R 755 /app chmod -R 755 /app
# Copy source code, maintaining directory structure # Copy source code, maintaining directory structure
COPY setup.py requirements.txt /app/ COPY setup.py requirements.txt pyproject.toml /app/
COPY src /app/src/ COPY src /app/src/
# Set PYTHONPATH # Set PYTHONPATH
@@ -37,10 +37,8 @@ RUN pip install --no-cache-dir -r requirements.txt
RUN set -e && \ RUN set -e && \
echo "Installing package..." && \ echo "Installing package..." && \
pip uninstall -y simpleguardhome || true && \ pip uninstall -y simpleguardhome || true && \
# First install dependencies only # Install package with dependencies and PEP 517 support
pip install --no-deps -v -e . && \ pip install --use-pep517 -e . && \
# Then install package with dependencies
pip install -e . && \
echo "Verifying installation..." && \ echo "Verifying installation..." && \
pip show simpleguardhome && \ pip show simpleguardhome && \
# List all package files # List all package files

View File

@@ -5,6 +5,12 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "simpleguardhome" name = "simpleguardhome"
version = "0.1.0" version = "0.1.0"
description = "SimpleGuardHome - A lightweight AdGuardHome UI"
authors = [
{name = "SimpleGuardHome Team"}
]
readme = "README.md"
license = {file = "LICENSE"}
requires-python = ">=3.7" requires-python = ">=3.7"
dependencies = [ dependencies = [
"fastapi", "fastapi",
@@ -20,4 +26,7 @@ package-dir = {"" = "src"}
packages = {find = {where = ["src"]}} packages = {find = {where = ["src"]}}
[tool.setuptools.package-data] [tool.setuptools.package-data]
simpleguardhome = ["templates/*", "favicon.ico"] simpleguardhome = ["templates/*", "favicon.ico"]
[tool.setuptools.editable]
mode = "compat"