feat:linebot

1. change Dockerfile
2. change the way import
This commit is contained in:
2026-03-10 10:25:52 +08:00
parent 065d3d352a
commit c58e35c98d
6 changed files with 34 additions and 17 deletions

View File

@@ -1,9 +1,7 @@
FROM python:3.11-slim
# 安裝 uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# 安裝 Playwright 需要的系統依賴
RUN apt-get update && apt-get install -y \
wget \
gnupg \
@@ -24,17 +22,15 @@ RUN apt-get update && apt-get install -y \
WORKDIR /app
# 複製 uv 設定檔
COPY pyproject.toml .
COPY uv.lock* .
# pyproject.toml 在 app/ 裡
COPY app/pyproject.toml .
COPY app/uv.lock* .
# 安裝依賴
RUN uv sync --frozen
# 安裝 Playwright Chromium
RUN uv run playwright install chromium
RUN uv run playwright install-deps chromium
COPY . .
# 只複製 app/ 的內容進去
COPY app/ .
CMD ["uv", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
CMD ["uv", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]