jung-ming commited on
Commit
a8c37b4
·
verified ·
1 Parent(s): 5510cda

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -1
Dockerfile CHANGED
@@ -1,15 +1,27 @@
1
  FROM python:3.10-slim
2
 
3
- RUN apt-get update && apt-get install -y fonts-noto-cjk
 
 
 
4
 
 
5
  WORKDIR /app
6
 
 
7
  COPY requirements.txt .
8
 
 
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
 
11
  COPY . .
12
 
 
 
 
 
13
  EXPOSE 8501
14
 
 
15
  CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
1
  FROM python:3.10-slim
2
 
3
+ # 安裝中文字型(含 Noto CJK)
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ fonts-noto-cjk \
6
+ && rm -rf /var/lib/apt/lists/*
7
 
8
+ # 設定工作目錄
9
  WORKDIR /app
10
 
11
+ # 複製 requirements
12
  COPY requirements.txt .
13
 
14
+ # 安裝 Python 套件
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ # 複製全部程式碼
18
  COPY . .
19
 
20
+ # 👉 更新 matplotlib 字型快取(關鍵!)
21
+ RUN python -c "import matplotlib; matplotlib.font_manager._rebuild()"
22
+
23
+ # 開放 port
24
  EXPOSE 8501
25
 
26
+ # 執行 Streamlit
27
  CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]