2023-11-13 17:03:55 +03:00
|
|
|
# Using a slim version for a smaller base image
|
2024-04-27 14:42:24 +03:00
|
|
|
FROM python:3.11.6-slim-bullseye@sha256:0c1fbb294096d842ad795ee232d783cab436c90b034210fe894f2bb2f2be7626 AS base
|
2023-06-01 17:01:27 +03:00
|
|
|
|
2023-10-09 16:23:13 +03:00
|
|
|
ARG DEV_MODE
|
|
|
|
ENV DEV_MODE=$DEV_MODE
|
|
|
|
|
2023-11-13 17:03:55 +03:00
|
|
|
# Install GEOS library, Rust, and other dependencies, then clean up
|
2024-04-28 15:34:44 +03:00
|
|
|
RUN apt-get clean && apt-get update && apt-get install -y \
|
2023-08-25 12:05:24 +03:00
|
|
|
libgeos-dev \
|
2023-09-14 12:56:59 +03:00
|
|
|
libcurl4-openssl-dev \
|
|
|
|
libssl-dev \
|
2023-08-25 12:05:24 +03:00
|
|
|
binutils \
|
2023-11-18 21:23:56 +03:00
|
|
|
pandoc \
|
2023-08-25 12:05:24 +03:00
|
|
|
curl \
|
2023-09-14 12:56:59 +03:00
|
|
|
git \
|
2023-11-22 19:26:11 +03:00
|
|
|
poppler-utils \
|
|
|
|
tesseract-ocr \
|
2024-01-26 02:56:46 +03:00
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
build-essential \
|
|
|
|
libtool \
|
|
|
|
python-dev \
|
2024-04-27 14:42:24 +03:00
|
|
|
wget \
|
2024-02-13 06:56:20 +03:00
|
|
|
# Additional dependencies for document handling
|
|
|
|
libmagic-dev \
|
|
|
|
poppler-utils \
|
|
|
|
tesseract-ocr \
|
|
|
|
libreoffice \
|
2024-02-15 07:29:57 +03:00
|
|
|
libpq-dev \
|
|
|
|
gcc \
|
2024-02-13 06:56:20 +03:00
|
|
|
pandoc && \
|
2024-04-27 14:42:24 +03:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
2023-05-21 02:20:55 +03:00
|
|
|
|
2023-08-25 12:05:24 +03:00
|
|
|
# Add Rust binaries to the PATH
|
|
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
|
|
|
2024-04-27 14:42:24 +03:00
|
|
|
RUN ARCHITECTURE=$(uname -m) && \
|
|
|
|
if [ "$ARCHITECTURE" = "x86_64" ]; then \
|
|
|
|
wget https://github.com/supabase/cli/releases/download/v1.163.6/supabase_1.163.6_linux_amd64.deb && \
|
|
|
|
dpkg -i supabase_1.163.6_linux_amd64.deb && \
|
|
|
|
rm supabase_1.163.6_linux_amd64.deb; \
|
|
|
|
elif [ "$ARCHITECTURE" = "aarch64" ]; then \
|
|
|
|
wget https://github.com/supabase/cli/releases/download/v1.163.6/supabase_1.163.6_linux_arm64.deb && \
|
|
|
|
dpkg -i supabase_1.163.6_linux_arm64.deb && \
|
|
|
|
rm supabase_1.163.6_linux_arm64.deb; \
|
|
|
|
fi && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2023-05-21 02:20:55 +03:00
|
|
|
WORKDIR /code
|
|
|
|
|
2023-08-18 13:57:16 +03:00
|
|
|
# Copy just the requirements first
|
|
|
|
COPY ./requirements.txt .
|
2023-05-21 02:20:55 +03:00
|
|
|
|
2024-04-27 14:42:24 +03:00
|
|
|
# Upgrade pip and install dependencies
|
|
|
|
RUN pip install --no-cache-dir --upgrade pip && \
|
2024-05-08 17:20:35 +03:00
|
|
|
pip install --no-cache-dir -r requirements.txt && \
|
|
|
|
playwright install --with-deps
|
2023-11-13 12:13:56 +03:00
|
|
|
|
2023-08-18 13:57:16 +03:00
|
|
|
# Copy the rest of the application
|
|
|
|
COPY . .
|
2023-05-21 02:20:55 +03:00
|
|
|
|
2023-11-18 21:23:56 +03:00
|
|
|
EXPOSE 5050
|
|
|
|
|
|
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5050", "--workers", "6"]
|