diff --git a/Dockerfile b/Dockerfile index f4ed639..c34d40c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,7 +49,7 @@ CMD ["python", "main.py", "admin"] FROM oci.reg.darano.ir/mcr.microsoft.com/playwright:v1.62.0-noble AS worker -# Install Python 3.12 + uv (the Playwright image has browsers but no Python). +# Install Python 3.12 + uv, then sync deps — all in one RUN so PATH is consistent. # Use a mirror for apt since the VPS has network restrictions (Iran). # curl is already installed (playwright system dep). RUN printf 'Types: deb\nURIs: http://repo.iut.ac.ir/ubuntu/\nSuites: noble noble-updates noble-security\nComponents: main restricted universe multiverse\nSigned-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg\n' \ @@ -58,7 +58,8 @@ RUN printf 'Types: deb\nURIs: http://repo.iut.ac.ir/ubuntu/\nSuites: noble noble python3 python3-venv \ && rm -rf /var/lib/apt/lists/* \ && curl -LsSf https://astral.sh/uv/install.sh | \ - UV_INSTALL_DIR=/usr/local sh + UV_INSTALL_DIR=/usr/local sh \ + && /usr/local/bin/uv sync --frozen --no-dev --no-install-project ENV PATH="/app/.venv/bin:$PATH" \ PYTHONUNBUFFERED=1 \ @@ -73,9 +74,6 @@ WORKDIR /app # Copy manifests first (stable cache layer) COPY pyproject.toml uv.lock* ./ -# Install project deps into a venv targeting this image's Python 3.12 -RUN uv sync --frozen --no-dev --no-install-project - # Copy app code COPY . .