File size: 1,242 Bytes
c754148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.11-slim

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*
COPY requirements.txt /app/requirements.txt

# Install Python dependencies
# --no-cache-dir keeps image size small
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Copy all source files and scripts
COPY src/ /app/src/
COPY scripts/ /app/scripts/

# Copy data directory (skill_aliases.json)
COPY data/ /app/data/

# Copy precomputed artifacts (BM25 index + LightGBM model)
# Generated by precompute.py — must exist before building image
COPY precomputed/ /app/precomputed/

# Create output directories
RUN mkdir -p /app/logs /app/out

# Default candidates file location (override with -v mount)
# The full candidates.jsonl is NOT baked into the image (487MB) — mount it.
ENV CANDIDATES_PATH=/app/candidates.jsonl
ENV OUT_PATH=/app/out/CTRL_COFFEE_REPEAT.csv
ENV BASE_DIR=/app

# Entrypoint script selects precompute, rank, or full pipeline
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
RUN chmod +x /app/docker-entrypoint.sh

# Default: run full pipeline (precompute + rank)
CMD ["/app/docker-entrypoint.sh", "full"]