update: add entrypoint

This commit is contained in:
tao.chen
2026-07-29 10:26:59 +08:00
parent a4e4e5b0db
commit df7ccff2b7
3 changed files with 35 additions and 6 deletions
+20 -5
View File
@@ -19,10 +19,10 @@ RUN mkdir -p /etc/apt/keyrings \
&& apt-get update && apt-get install -y nodejs --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# 安装 uv 并利用 uv 下载 Python 3.11
# 安装 uv 并利用 uv 下载 Python 3.12
ENV UV_INSTALL_DIR=/opt/uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
&& /opt/uv/uv python install 3.11
&& /opt/uv/uv python install 3.12
# ==========================================
@@ -53,11 +53,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# 2. 从 builder 复制 uv 和由 uv 管理的 Python 3.11
# 2. 从 builder 复制 uv 和由 uv 管理的 Python 3.12
COPY --from=builder /opt/uv/uv /usr/local/bin/uv
COPY --from=builder /root/.local/share/uv/python /root/.local/share/uv/python
RUN uv --version
RUN uv venv /opt/venv --python 3.11
COPY ./fs-backend /app/fs-backend
RUN cd /app/fs-backend && \
uv venv && \
uv pip install \
--index-url https://pypi.tuna.tsinghua.edu.cn/simple/ \
--requirements ./requirements.txt
RUN uv venv /opt/venv --python 3.12
ENV PATH="/opt/venv/bin:$PATH"
COPY requirements.txt /tmp/requirements.txt
RUN uv pip install \
@@ -71,4 +80,10 @@ RUN opencode --version
COPY skills /root/.config/opencode/skills
COPY csv2json /root/workspace/csv2json
ENTRYPOINT ["opencode"]
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
# 入口脚本作为 ENTRYPOINT,并将 opencode 作为默认执行指令/参数
ENTRYPOINT ["entrypoint.sh"]
CMD ["opencode"]