LONGYKING
commited on
Commit
·
1f9439e
1
Parent(s):
442ee03
updated dockerfile to fix permission issues
Browse files- Dockerfile +6 -1
Dockerfile
CHANGED
|
@@ -1,6 +1,11 @@
|
|
| 1 |
# Use an official Python runtime as a parent image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
# Set the working directory in the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
|
@@ -11,7 +16,7 @@ RUN apt-get update && apt-get install -y \
|
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
# Copy the rest of the application code into the container
|
| 14 |
-
COPY . .
|
| 15 |
|
| 16 |
# Install any needed packages specified in requirements.txt
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 1 |
# Use an official Python runtime as a parent image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# Create a user and set permissions
|
| 5 |
+
RUN useradd -m -u 1000 user
|
| 6 |
+
USER user
|
| 7 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 8 |
+
|
| 9 |
# Set the working directory in the container
|
| 10 |
WORKDIR /app
|
| 11 |
|
|
|
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
# Copy the rest of the application code into the container
|
| 19 |
+
COPY --chown=user . .
|
| 20 |
|
| 21 |
# Install any needed packages specified in requirements.txt
|
| 22 |
RUN pip install --no-cache-dir -r requirements.txt
|