1
0
Fork 0

Switch to uv for dependency management and streamline Dockerfile

- Replaced `pip install` with `uv sync --frozen` for improved dependency handling.
- Simplified Dockerfile by removing unused packages and redundant commands.
- Updated test and execution steps to utilize `uv` for consistency.
This commit is contained in:
Joao Gilberto Magalhaes 2026-02-06 20:36:26 -05:00
parent 17f40bf2bd
commit 7363538b5e

View file

@ -5,9 +5,8 @@ ARG RELEASE_VERSION_ARG
ENV RELEASE_VERSION=$RELEASE_VERSION_ARG ENV RELEASE_VERSION=$RELEASE_VERSION_ARG
ENV TZ="Etc/UTC" ENV TZ="Etc/UTC"
RUN apk add --no-cache haproxy bash python3 py3-pip py-yaml certbot openssl curl \ RUN apk add --no-cache haproxy bash python3 certbot openssl curl \
&& apk add --no-cache --virtual .build-deps build-base python3-dev musl-dev linux-headers \ && apk add --no-cache --virtual .build-deps build-base python3-dev musl-dev linux-headers \
&& pip3 install --upgrade pip --break-system-packages \
&& curl -LsSf https://astral.sh/uv/install.sh | sh \ && curl -LsSf https://astral.sh/uv/install.sh | sh \
&& ln -s /root/.local/bin/uv /usr/local/bin/uv && ln -s /root/.local/bin/uv /usr/local/bin/uv
@ -18,14 +17,14 @@ WORKDIR /scripts
COPY build/assets / COPY build/assets /
COPY pyproject.toml LICENSE README.md /scripts/ COPY pyproject.toml uv.lock LICENSE README.md /scripts/
COPY src/ /scripts/ COPY src/ /scripts/
COPY tests/ /scripts/tests/ COPY tests/ /scripts/tests/
RUN cd /scripts && uv pip install --python /usr/bin/python3 --break-system-packages ".[dev]" RUN cd /scripts && uv sync --frozen
RUN apk del .build-deps RUN apk del .build-deps
RUN cd /scripts && pytest -s -vv tests/ RUN cd /scripts && uv run pytest -s -vv tests/
CMD ["/usr/bin/python", "-u", "/scripts/main.py" ] CMD ["uv", "run", "python", "-u", "/scripts/main.py"]