-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (25 loc) · 914 Bytes
/
Dockerfile
File metadata and controls
37 lines (25 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# SPDX-FileCopyrightText: Copyright (c) 2019-2026 Aibolit
# SPDX-License-Identifier: MIT
FROM python:3.14-slim AS builder
COPY --from=ghcr.io/astral-sh/uv:0.11.19 /uv /uvx /bin/
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
WORKDIR /app
# Install deps first
COPY pyproject.toml uv.lock README.md LICENSE.txt ./
RUN uv sync --frozen --no-dev --no-install-project
# Now copy source and do the final sync (installs the project itself)
COPY aibolit ./aibolit
RUN uv sync --frozen --no-dev
FROM python:3.14-slim
# Create a non-root user and group
RUN groupadd --system appgroup \
&& useradd --system --gid appgroup --no-create-home appuser
WORKDIR /app
COPY --from=builder --chown=appuser:appgroup /app/.venv /app/.venv
COPY --from=builder --chown=appuser:appgroup /app/aibolit /app/aibolit
ENV PATH="/app/.venv/bin:$PATH"
ENV VIRTUAL_ENV=/app/.venv
USER appuser
ENTRYPOINT ["aibolit"]
CMD ["--help"]