-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile.web
More file actions
50 lines (40 loc) · 2.23 KB
/
Dockerfile.web
File metadata and controls
50 lines (40 loc) · 2.23 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
# syntax=docker/dockerfile:1.4
# ─────────────────────────────────────────────────────────────────────────────
# Dockerfile.web — lightweight image for backend (gunicorn) + celery-beat
#
# Does NOT contain any conda model environments.
# Code-only changes rebuild only from the COPY . . layer (~5–10 s).
# Requirements changes rebuild only from the pip install layer (~1–3 min).
# ─────────────────────────────────────────────────────────────────────────────
FROM python:3.12-slim
WORKDIR /app
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=0
# Minimal system runtime deps
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
libgomp1 \
wget \
&& rm -rf /var/lib/apt/lists/*
# ── MMseqs2 static binary (needed by /validate/?runSimilarity=true) ───────────
# Use the SSE4.1 build — compatible with older/virtualised CPUs that lack AVX2.
# Fall back to sse2 if even that fails: change "sse41" → "sse2" below.
RUN wget -q https://mmseqs.com/latest/mmseqs-linux-sse41.tar.gz -O /tmp/mmseqs.tar.gz \
&& tar -xzf /tmp/mmseqs.tar.gz -C /tmp \
&& mv /tmp/mmseqs/bin/mmseqs /usr/local/bin/mmseqs \
&& chmod +x /usr/local/bin/mmseqs \
&& rm -rf /tmp/mmseqs /tmp/mmseqs.tar.gz
# ── Python dependencies (cached until requirements.txt changes) ───────────────
COPY requirements.txt ./
RUN --mount=type=cache,id=webkinpred-pip-web-py312,target=/root/.cache/pip,sharing=locked \
pip install -r requirements.txt
# ── Application code (only this layer + below rebuild on git pull) ────────────
COPY . .
RUN mkdir -p /app/media/sequence_info \
/app/staticfiles \
/app/mmseqs_tmp \
&& chmod 777 /app/mmseqs_tmp
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -f http://localhost:8000/api/health/ || exit 1