phuphan1310 commited on
Commit
4011cbe
·
verified ·
1 Parent(s): 837ec30

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -3
Dockerfile CHANGED
@@ -2,11 +2,27 @@ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
- COPY . .
9
 
10
- EXPOSE 7860
 
11
 
12
- CMD ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # Cài dependencies cơ bản
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ curl \
9
+ git \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Cache model vào thư mục có quyền ghi
13
+ RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache
14
+ ENV TRANSFORMERS_CACHE=/app/hf_cache
15
+ ENV HF_HOME=/app/hf_cache
16
+ ENV HF_HUB_DISABLE_SYMLINKS_WARNING=1
17
+
18
+ # Copy files
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
+ COPY src/ ./src/
23
 
24
+ # Expose port
25
+ EXPOSE 8501
26
 
27
+ # Run app
28
+ ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]