mobenta commited on
Commit
8324e06
·
verified ·
1 Parent(s): 40e0008

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -7
Dockerfile CHANGED
@@ -1,15 +1,15 @@
1
  # Dockerfile
2
  FROM python:3.10-slim
3
 
4
- # Install LibreOffice, unoconv, and other dependencies required for file conversion
5
- # unoconv is a reliable command-line utility for conversion on Linux
6
  RUN apt-get update && \
7
  apt-get install -y \
8
  libreoffice \
9
  unoconv \
10
  python3-uno \
11
- # Add 'locales' package if your build encounters locale errors
12
- # locales \
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
- # Install Python dependencies from requirements.txt
22
- COPY requirements.txt /home/user/app/
23
  WORKDIR /home/user/app
24
 
25
- # Install dependencies (only gradio should be here now)
 
 
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