koler commited on
Commit
eb32fe1
·
verified ·
1 Parent(s): 3db455a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -64
Dockerfile CHANGED
@@ -1,71 +1,18 @@
1
- # FROM python:3.9-slim
2
-
3
- # WORKDIR /app
4
-
5
- # # RUN apt-get update && apt-get install -y \
6
- # # build-essential \
7
- # # curl \
8
- # # software-properties-common \
9
- # # git \
10
- # # && rm -rf /var/lib/apt/lists/*
11
-
12
-
13
- # # RUN apt-get update && apt-get install -y \
14
- # # build-essential \
15
- # # libssl-dev \
16
- # # libffi-dev \
17
- # # python3-dev \
18
- # # && rm -rf /var/lib/apt/lists/*
19
-
20
- # RUN apt-get update && apt-get install -y \
21
- # libfreetype6 \
22
- # libjpeg62-turbo \
23
- # libpng16-16 \
24
- # libxext6 \
25
- # libx11-6
26
-
27
- # COPY requirements.txt ./
28
- # COPY src/ ./src/
29
-
30
- # RUN pip3 install -r requirements.txt
31
-
32
- # EXPOSE 8501
33
-
34
- # HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
35
-
36
- # ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
37
-
38
-
39
-
40
- FROM python:3.9-slim
41
 
 
42
  WORKDIR /app
43
 
44
- # Create cache directory with proper permissions
45
- RUN mkdir -p /app/.cache && \
46
- chmod -R 777 /app && \
47
- apt-get update && apt-get install -y \
48
- build-essential \
49
- libgl1 \
50
- libglib2.0-0 \
51
- && rm -rf /var/lib/apt/lists/*
52
-
53
- # Set environment variables for Hugging Face
54
- ENV TRANSFORMERS_CACHE=/app/.cache \
55
- HF_HOME=/app/.cache \
56
- HUGGINGFACE_HUB_CACHE=/app/.cache
57
-
58
  COPY requirements.txt .
59
- COPY src/streamlit_app.py .
60
-
61
- # Add this before pip install
62
- # RUN python -m pip install --upgrade pip
63
-
64
- # RUN pip3 install -r requirements.txt
65
-
66
 
67
- EXPOSE 8501
 
68
 
69
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
 
70
 
71
- ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
1
+ # Use a Python base image
2
+ FROM python:3.10-slim
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
+ # Set working directory
5
  WORKDIR /app
6
 
7
+ # Copy requirements and install them
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
10
 
11
+ # Copy your Streamlit app
12
+ COPY app.py .
13
 
14
+ # Expose the correct port for Hugging Face
15
+ EXPOSE 7860
16
 
17
+ # Use CMD with python -m to ensure it works even if streamlit is not globally linked
18
+ CMD ["python", "-m", "streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]