restructure backend
This commit is contained in:
20
dockerfile
20
dockerfile
@@ -11,14 +11,22 @@ RUN apt-get update && apt-get install -y \
|
||||
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 torch --index-url https://download.pytorch.org/whl/cpu
|
||||
RUN pip3 install --no-cache-dir fastapi uvicorn pillow open-clip-torch numpy faiss-cpu python-multipart
|
||||
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 ./python_service
|
||||
COPY python_service/app.py ./python_service/app.py
|
||||
COPY src ./src
|
||||
COPY package.json .
|
||||
COPY bun.lock .
|
||||
@@ -26,6 +34,10 @@ COPY bun.lock .
|
||||
# --- Expose ports ---
|
||||
EXPOSE 3000
|
||||
|
||||
# --- Environment variables for external paths ---
|
||||
ENV IMAGES_DIR=/images/cards
|
||||
ENV FAISS_DIR=/faiss
|
||||
|
||||
# --- Start services ---
|
||||
# Use & to run Python worker in background, Bun frontend as main process
|
||||
# Python FAISS worker runs in background, Bun frontend as main process
|
||||
CMD python3 python_service/app.py & bun run src/index.ts
|
||||
|
||||
Reference in New Issue
Block a user