laichai commited on
Commit
522f3ad
·
verified ·
1 Parent(s): c098f01

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -18
Dockerfile CHANGED
@@ -1,25 +1,32 @@
1
- FROM python:3.10
 
2
 
3
- # Create user
4
- RUN useradd -m -u 1000 user
5
- USER user
6
- ENV HOME=/home/user \
7
- PATH=/home/user/.local/bin:$PATH
 
 
 
 
 
 
8
 
9
- # Set working directory
10
- WORKDIR $HOME/app
11
 
12
- # Install requirements
13
- COPY --chown=user requirements.txt requirements.txt
14
- RUN pip install --no-cache-dir --upgrade pip && \
15
- pip install --no-cache-dir -r requirements.txt
16
 
17
- # Copy app files
18
- COPY --chown=user . .
19
 
20
- # Expose Port
21
- EXPOSE 8501
22
 
23
- # --- THE FIX: Shell Command Format (No brackets) ---
24
- CMD streamlit run app.py --server.port 8501 --server.address 0.0.0.0 --server.headless true --server.enableCORS false --server.enableXsrfProtection false
25
 
 
 
 
1
+ # Use the official Python image
2
+ FROM python:3.9-slim
3
 
4
+ # 1. Install System Dependencies (LaTeX)
5
+ # We use --no-install-recommends to keep the image smaller, but install the necessary parts.
6
+ RUN apt-get update && \
7
+ apt-get install -y \
8
+ texlive-latex-base \
9
+ texlive-latex-extra \
10
+ texlive-science \
11
+ texlive-fonts-recommended \
12
+ texlive-fonts-extra \
13
+ ghostscript \
14
+ && rm -rf /var/lib/apt/lists/*
15
 
16
+ # 2. Set up the working directory
17
+ WORKDIR /app
18
 
19
+ # 3. Copy your specific requirements file first (for caching)
20
+ COPY requirements.txt .
 
 
21
 
22
+ # 4. Install Python dependencies
23
+ RUN pip install --no-cache-dir -r requirements.txt
24
 
25
+ # 5. Copy the rest of your application code
26
+ COPY . .
27
 
28
+ # 6. Expose the port used by Streamlit (7860 is standard for Hugging Face)
29
+ EXPOSE 7860
30
 
31
+ # 7. Run the application
32
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]