-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (25 loc) · 1.14 KB
/
Copy pathDockerfile
File metadata and controls
36 lines (25 loc) · 1.14 KB
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
# ── Stage 1: build ──────────────────────────────────────────────────────────
FROM python:3.11-slim AS builder
WORKDIR /app
# Install build tools
RUN pip install --upgrade pip build
# Copy project files required for the build
COPY pyproject.toml requirements.txt ./
COPY logsight/ logsight/
# Build the wheel
RUN python -m build --wheel --outdir /dist
# ── Stage 2: runtime ─────────────────────────────────────────────────────────
FROM python:3.11-slim AS runtime
LABEL maintainer="Trojan3877" \
description="LogSight-AI: AI-powered log analysis and anomaly detection" \
version="0.1.0"
# Create a non-root user for security
RUN useradd --create-home --shell /bin/bash logsight
WORKDIR /app
# Install the built wheel from the builder stage
COPY --from=builder /dist/*.whl /tmp/
RUN pip install --no-cache-dir /tmp/*.whl && rm /tmp/*.whl
# Drop privileges
USER logsight
ENTRYPOINT ["logsight"]
CMD ["--help"]