File size: 1,156 Bytes
c4b28eb
1858e78
 
 
 
 
c4b28eb
 
 
1858e78
 
 
 
c4b28eb
1858e78
 
 
 
241bf1b
1858e78
 
 
 
 
 
 
 
c4b28eb
1858e78
c4b28eb
 
 
1858e78
 
 
 
 
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
# Use an official Python runtime as a parent image
FROM python:3.10-slim AS base
ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1 \
    PIP_DISABLE_PIP_VERSION_CHECK=1

WORKDIR /app

# Install build essentials only if needed for wheels (kept minimal)
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

COPY constraints.txt requirements.txt ./
RUN python -m pip install --upgrade pip setuptools wheel \
    && pip install --no-cache-dir -r requirements.txt -c constraints.txt --only-binary=:all: || \
    pip install --no-cache-dir -r requirements.txt -c constraints.txt

# Application source
COPY app.py ./app.py
COPY templates ./templates
COPY static ./static
COPY src ./src
COPY data ./data
COPY scripts ./scripts
COPY run.sh ./run.sh

RUN chmod +x run.sh && chmod +x scripts/init_pgvector.py || true

EXPOSE 10000
CMD ["/app/run.sh"]

# Optional dev stage for local tooling (not used in final image)
FROM base AS dev
COPY dev-requirements.txt ./dev-requirements.txt
RUN pip install --no-cache-dir -r dev-requirements.txt -c constraints.txt || true