FROM python:3.9-slim WORKDIR /app COPY . /app RUN pip install --no-cache-dir -r requirements.txt # 新增:初始化資料庫(從 data.json 載入到 books.db) RUN python -c "from database import init_db; init_db()" EXPOSE 7860 CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]