44 lines
1.1 KiB
Plaintext
44 lines
1.1 KiB
Plaintext
# --- Base image with Node + Python ---
|
|
FROM ubuntu:22.04
|
|
|
|
# --- Install system dependencies ---
|
|
RUN apt-get update && apt-get install -y \
|
|
curl python3 python3-pip git build-essential libgl1 libglvnd0 ffmpeg unzip \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# --- Install Bun ---
|
|
RUN curl -fsSL https://bun.sh/install | bash
|
|
ENV PATH="/root/.bun/bin:${PATH}"
|
|
|
|
# --- Upgrade pip ---
|
|
RUN pip3 install --upgrade pip
|
|
|
|
# --- Install Python dependencies ---
|
|
RUN pip3 install --upgrade pip
|
|
RUN pip3 install fastapi uvicorn pillow torch open-clip-torch numpy faiss-cpu python-multipart
|
|
|
|
# --- Set working directory ---
|
|
WORKDIR /app
|
|
|
|
# --- Create directories for external data ---
|
|
RUN mkdir -p /images/cards /faiss
|
|
|
|
# --- Copy project files ---
|
|
WORKDIR /app
|
|
COPY python_service/app.py ./python_service/app.py
|
|
COPY src ./src
|
|
COPY package.json .
|
|
COPY bun.lock .
|
|
|
|
# --- Expose ports ---
|
|
EXPOSE 3000
|
|
|
|
# --- Environment variables for external paths ---
|
|
ENV IMAGES_DIR=/images/cards
|
|
ENV FAISS_DIR=/faiss
|
|
|
|
# --- Start services ---
|
|
# Python FAISS worker runs in background, Bun frontend as main process
|
|
CMD python3 python_service/app.py & bun run src/index.ts
|