Skip to content

Commit cef0b76

Browse files
authored
Merge pull request #9 from CentreonLabs/SAAS-1997-fix-security-issue-on-github
Migrate from poetry to uv
2 parents cc74850 + c2055b8 commit cef0b76

File tree

5 files changed

+1545
-2090
lines changed

5 files changed

+1545
-2090
lines changed

.dockerignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.venv
2+
.git
3+
.github
4+
.gitignore
5+
.mypy_cache
6+
.ruff_cache
7+
build
8+
neo.egg-info
9+
compose.yaml
10+
Dockerfile
11+
.dockerignore

Dockerfile

+13-27
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,23 @@
1-
FROM python:3.10-slim
2-
3-
ENV PYTHONFAULTHANDLER=1 \
4-
PYTHONUNBUFFERED=1 \
5-
PYTHONHASHSEED=random \
6-
PIP_NO_CACHE_DIR=off \
7-
PIP_DISABLE_PIP_VERSION_CHECK=on \
8-
PIP_DEFAULT_TIMEOUT=100 \
9-
POETRY_VERSION=1.8.3 \
10-
POETRY_NO_INTERACTION=1 \
11-
POETRY_VIRTUALENVS_CREATE=0 \
12-
POETRY_CACHE_DIR=/tmp/poetry_cache
13-
14-
# System deps:
15-
RUN pip install "poetry==$POETRY_VERSION"
1+
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
162

173
# Set working directory:
18-
WORKDIR /code
4+
WORKDIR /app
195

20-
# Copy only requirements to cache them in docker layer
21-
COPY poetry.lock pyproject.toml README.md /code/
6+
# Install dependencies
7+
RUN --mount=type=cache,target=/root/.cache/uv \
8+
--mount=type=bind,source=uv.lock,target=uv.lock \
9+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
10+
uv sync --all-extras --frozen --no-install-project --no-dev
2211

23-
# Install dependencies:
24-
RUN poetry install --no-root --without dev
12+
# Copy the project into the image
13+
ADD . /app
2514

26-
# Copy the source code:
27-
COPY src/pop pop
28-
29-
# Install project:
30-
RUN poetry install --without dev
15+
# Sync the project
16+
RUN --mount=type=cache,target=/root/.cache/uv \
17+
uv sync --all-extras --frozen --no-dev
3118

3219
# Exposing port:
3320
EXPOSE 8000
3421

3522
# Running command:
36-
CMD ["poetry", "run", "pop"]
37-
23+
CMD ["uv", "run", "pop"]

0 commit comments

Comments
 (0)