Commit ·
fb65b44
1
Parent(s): 6a9f965
Fix Dockerfile user order
Browse files- Dockerfile +4 -2
Dockerfile
CHANGED
|
@@ -15,11 +15,13 @@ COPY requirements.txt .
|
|
| 15 |
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
# Copy source code and fix permissions
|
| 19 |
COPY --chown=user:user . .
|
| 20 |
|
| 21 |
-
# Create a non-root user (Hugging Face Recommended)
|
| 22 |
-
RUN useradd -m -u 1000 user
|
| 23 |
USER user
|
| 24 |
ENV HOME=/home/user \
|
| 25 |
PATH=/home/user/.local/bin:$PATH
|
|
|
|
| 15 |
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
+
# Create a non-root user (Hugging Face Recommended)
|
| 19 |
+
# Must create user BEFORE copying files so --chown works
|
| 20 |
+
RUN useradd -m -u 1000 user
|
| 21 |
+
|
| 22 |
# Copy source code and fix permissions
|
| 23 |
COPY --chown=user:user . .
|
| 24 |
|
|
|
|
|
|
|
| 25 |
USER user
|
| 26 |
ENV HOME=/home/user \
|
| 27 |
PATH=/home/user/.local/bin:$PATH
|