-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
72 lines (53 loc) · 2.28 KB
/
Dockerfile
File metadata and controls
72 lines (53 loc) · 2.28 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# ============================================================
# BioAgentFlow Dockerfile
# Lightweight AI-powered drug virtual screening platform
# ============================================================
# --- Stage 1: Builder ---
FROM python:3.10-slim AS builder
# China mainland apt mirror (uncomment if needed):
# RUN sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc \
g++ \
libffi-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY requirements.txt .
# China mainland pip mirror (uncomment if needed):
# RUN pip install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN pip install --no-cache-dir .
# --- Stage 2: Runtime ---
FROM python:3.10-slim AS runtime
# China mainland apt mirror (uncomment if needed):
# RUN sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources
RUN apt-get update && apt-get install -y --no-install-recommends \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd --gid 1000 bioagent \
&& useradd --uid 1000 --gid bioagent --create-home bioagent
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
COPY --from=builder /usr/local/bin/bioagentflow /usr/local/bin/bioagentflow
COPY --from=builder /usr/local/bin/streamlit /usr/local/bin/streamlit || true
WORKDIR /app
COPY --from=builder /build /app
RUN mkdir -p /app/data /app/output /app/cache \
&& chown -R bioagent:bioagent /app
USER bioagent
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
BIOAGENTFLOW_DATA_DIR=/app/data \
BIOAGENTFLOW_CACHE_DIR=/app/cache
EXPOSE 8501
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import bioagentflow; print('ok')" || exit 1
# Default: launch Streamlit UI. Override with CLI commands as needed.
# Examples:
# docker run bioagentflow bioagentflow run --config pipeline.yaml
# docker run bioagentflow bioagentflow dock --config dock.yaml
CMD ["streamlit", "run", "bioagentflow/ui/app.py", \
"--server.port=8501", \
"--server.address=0.0.0.0", \
"--server.headless=true"]