-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (24 loc) · 791 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (24 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ============================================================
# Sen NoneBot2 Dockerfile
# 多阶段构建:builder 装依赖,runtime 只拷贝产物
# ============================================================
# ---- Builder ----
FROM python:3.12-slim AS builder
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
WORKDIR /app
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev
COPY . .
# ---- Runtime ----
FROM python:3.12-slim
WORKDIR /app
COPY --from=builder /app/.venv /app/.venv
COPY --from=builder /app/sen_bot /app/sen_bot
COPY --from=builder /app/bot.py /app/bot.py
RUN mkdir -p /app/data
ENV PATH="/app/.venv/bin:$PATH" \
TZ=Asia/Shanghai \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
EXPOSE 8003
CMD ["python", "bot.py"]