Spaces:
Runtime error
Runtime error
non-root user aftr installing system dependencies
Browse files- Dockerfile +5 -5
Dockerfile
CHANGED
|
@@ -1,5 +1,10 @@
|
|
| 1 |
FROM python:3.12-slim
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
# Create a non-root user
|
| 4 |
RUN useradd -m -u 1000 user
|
| 5 |
USER user
|
|
@@ -7,11 +12,6 @@ ENV PATH="/home/user/.local/bin:$PATH"
|
|
| 7 |
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
-
# Install system dependencies
|
| 11 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 12 |
-
build-essential \
|
| 13 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
-
|
| 15 |
# Copy source code and dependency files FIRST (needed by flit)
|
| 16 |
COPY --chown=user pyproject.toml ./
|
| 17 |
COPY --chown=user nygaardcodecommentclassification ./nygaardcodecommentclassification
|
|
|
|
| 1 |
FROM python:3.12-slim
|
| 2 |
|
| 3 |
+
# Install system dependencies as root
|
| 4 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
+
build-essential \
|
| 6 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
+
|
| 8 |
# Create a non-root user
|
| 9 |
RUN useradd -m -u 1000 user
|
| 10 |
USER user
|
|
|
|
| 12 |
|
| 13 |
WORKDIR /app
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
# Copy source code and dependency files FIRST (needed by flit)
|
| 16 |
COPY --chown=user pyproject.toml ./
|
| 17 |
COPY --chown=user nygaardcodecommentclassification ./nygaardcodecommentclassification
|