Zeqhx commited on
Commit
e4a859c
·
verified ·
1 Parent(s): 8428d51

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -20
Dockerfile CHANGED
@@ -1,20 +1,35 @@
1
- FROM python:3.13.5-slim
2
-
3
- WORKDIR /app
4
-
5
- RUN apt-get update && apt-get install -y \
6
- build-essential \
7
- curl \
8
- git \
9
- && rm -rf /var/lib/apt/lists/*
10
-
11
- COPY requirements.txt ./
12
- COPY src/ ./src/
13
-
14
- RUN pip3 install -r requirements.txt
15
-
16
- EXPOSE 8501
17
-
18
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
19
-
20
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ git \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Copy requirements first for better caching
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # Copy package source and install
16
+ COPY pyproject.toml .
17
+ COPY src/ ./src/
18
+ RUN pip install --no-cache-dir -e .
19
+
20
+ # Copy application files
21
+ COPY app.py .
22
+ COPY artifacts_50loc/ ./artifacts_50loc/
23
+ COPY data/ ./data/
24
+
25
+ # Expose Streamlit port
26
+ EXPOSE 7860
27
+
28
+ # Set environment variables for Streamlit
29
+ ENV STREAMLIT_SERVER_PORT=7860
30
+ ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
31
+ ENV STREAMLIT_SERVER_HEADLESS=true
32
+ ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
33
+
34
+ # Run the app
35
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]