Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -10
Dockerfile
CHANGED
|
@@ -38,21 +38,20 @@ COPY requirements.txt /app/
|
|
| 38 |
RUN pip install --no-cache-dir -U pip && \
|
| 39 |
pip install --no-cache-dir -r requirements.txt
|
| 40 |
|
| 41 |
-
#
|
| 42 |
-
# This prevents
|
| 43 |
-
RUN
|
| 44 |
-
|
| 45 |
-
chown -R user:user /app
|
| 46 |
|
| 47 |
-
# Ensure that the Playwright browser files are fully readable/executable by
|
| 48 |
# In the official Playwright image, browsers are stored in /ms-playwright.
|
| 49 |
RUN chmod -R 755 /ms-playwright
|
| 50 |
|
| 51 |
-
# Copy the rest of the application files to the container and set ownership to
|
| 52 |
-
COPY --chown=
|
| 53 |
|
| 54 |
-
# Switch to the non-root user
|
| 55 |
-
USER
|
| 56 |
|
| 57 |
# Expose the default port expected by Hugging Face Spaces (7860)
|
| 58 |
EXPOSE 7860
|
|
|
|
| 38 |
RUN pip install --no-cache-dir -U pip && \
|
| 39 |
pip install --no-cache-dir -r requirements.txt
|
| 40 |
|
| 41 |
+
# Leverage the pre-created 'pwuser' user (UID 1000) already defined in the official Playwright image
|
| 42 |
+
# This prevents UID collision errors during useradd and complies with HF Spaces UID 1000 requirement.
|
| 43 |
+
RUN mkdir -p /app/database /app/logs /app/exports && \
|
| 44 |
+
chown -R 1000:1000 /app
|
|
|
|
| 45 |
|
| 46 |
+
# Ensure that the Playwright browser files are fully readable/executable by the non-root user.
|
| 47 |
# In the official Playwright image, browsers are stored in /ms-playwright.
|
| 48 |
RUN chmod -R 755 /ms-playwright
|
| 49 |
|
| 50 |
+
# Copy the rest of the application files to the container and set ownership to UID 1000 (pwuser)
|
| 51 |
+
COPY --chown=1000:1000 . /app
|
| 52 |
|
| 53 |
+
# Switch to the non-root user (UID 1000)
|
| 54 |
+
USER 1000
|
| 55 |
|
| 56 |
# Expose the default port expected by Hugging Face Spaces (7860)
|
| 57 |
EXPOSE 7860
|