# server-core 镜像（多阶段）
FROM ghcr.io/astral-sh/uv:python3.12 AS base
WORKDIR /app
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy

# 依赖层（利用缓存）
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev --no-install-project

# 代码层
COPY app ./app
COPY dispatcher.py main.py pyproject.toml uv.lock ./
COPY serverdata ./serverdata
COPY serverrun ./serverrun

EXPOSE 8090
CMD ["bash", "serverrun/start.sh"]
