-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile.p2p-node
More file actions
42 lines (31 loc) · 1.25 KB
/
Dockerfile.p2p-node
File metadata and controls
42 lines (31 loc) · 1.25 KB
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
37
38
39
40
41
42
# MiroFish P2P Node — Backend + CLI
# 精簡版:只包含 Flask backend 和 Node CLI,不含前端
FROM python:3.11-slim
# ------ Node.js 22 + Build tools ------
RUN apt-get update && \
apt-get install -y --no-install-recommends curl ca-certificates gcc python3-dev && \
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y --no-install-recommends nodejs && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# ------ uv (Python package manager) ------
COPY --from=ghcr.io/astral-sh/uv:0.9.26 /uv /uvx /bin/
WORKDIR /app
# ------ Python 依賴 (MiroFish backend) ------
COPY MiroFish/backend/pyproject.toml MiroFish/backend/uv.lock ./backend/
RUN cd backend && uv sync --frozen
# ------ Entrypoint script ------
COPY scripts/p2p-node-entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# ------ 複製原始碼 ------
COPY MiroFish/backend/ ./backend/
COPY cli/ ./cli/
# ------ 工作目錄設定 ------
RUN mkdir -p /root/.mirofish
ENV FLASK_APP=app
ENV FLASK_RUN_HOST=0.0.0.0
ENV P2P_AUTO_PREDICT=true
ENV MIROFISH_CLI_PATH=/app/cli/bin/mirofish.js
EXPOSE 5001
HEALTHCHECK --interval=5s --timeout=3s --retries=10 --start-period=15s \
CMD curl -sf http://localhost:5001/health || exit 1
ENTRYPOINT ["/entrypoint.sh"]