Update Dockerfile
Browse files- Dockerfile +8 -7
Dockerfile
CHANGED
|
@@ -1,15 +1,15 @@
|
|
| 1 |
# Dockerfile
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Install
|
| 5 |
-
#
|
| 6 |
RUN apt-get update && \
|
| 7 |
apt-get install -y \
|
| 8 |
libreoffice \
|
| 9 |
unoconv \
|
| 10 |
python3-uno \
|
| 11 |
-
# Add 'locales' package if
|
| 12 |
-
|
| 13 |
&& \
|
| 14 |
rm -rf /var/lib/apt/lists/*
|
| 15 |
|
|
@@ -18,11 +18,12 @@ RUN useradd -m -u 1000 user
|
|
| 18 |
ENV HOME=/home/user
|
| 19 |
USER user
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
COPY requirements.txt /home/user/app/
|
| 23 |
WORKDIR /home/user/app
|
| 24 |
|
| 25 |
-
# Install dependencies
|
|
|
|
|
|
|
| 26 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
|
| 28 |
# Copy the application code
|
|
|
|
| 1 |
# Dockerfile
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# IMPORTANT: Install System Dependencies as the root user first.
|
| 5 |
+
# This step MUST come before switching to the 'user' account.
|
| 6 |
RUN apt-get update && \
|
| 7 |
apt-get install -y \
|
| 8 |
libreoffice \
|
| 9 |
unoconv \
|
| 10 |
python3-uno \
|
| 11 |
+
# Add 'locales' package if needed for environment stability
|
| 12 |
+
locales \
|
| 13 |
&& \
|
| 14 |
rm -rf /var/lib/apt/lists/*
|
| 15 |
|
|
|
|
| 18 |
ENV HOME=/home/user
|
| 19 |
USER user
|
| 20 |
|
| 21 |
+
# Set working directory for the user
|
|
|
|
| 22 |
WORKDIR /home/user/app
|
| 23 |
|
| 24 |
+
# Install Python dependencies from requirements.txt (should only contain 'gradio')
|
| 25 |
+
# Note: Ensure your requirements.txt only contains 'gradio'
|
| 26 |
+
COPY requirements.txt /home/user/app/
|
| 27 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 28 |
|
| 29 |
# Copy the application code
|