From 4a52a71956a8d46fcb7294ac71734504bb09bcc2 Mon Sep 17 00:00:00 2001 From: S. Solomon Darnell Date: Fri, 28 Mar 2025 21:52:21 -0500 Subject: two version of R2R are here --- R2R/Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 R2R/Dockerfile (limited to 'R2R/Dockerfile') diff --git a/R2R/Dockerfile b/R2R/Dockerfile new file mode 100755 index 00000000..ffce8344 --- /dev/null +++ b/R2R/Dockerfile @@ -0,0 +1,37 @@ +FROM python:3.10-slim AS builder + +# Install system dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc g++ musl-dev curl libffi-dev gfortran libopenblas-dev \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +RUN pip install --no-cache-dir poetry + +# Copy the dependencies files +COPY pyproject.toml poetry.lock* ./ + +# Install the dependencies, including gunicorn and uvicorn +RUN poetry config virtualenvs.create false \ + && poetry install --no-dev --no-root \ + && pip install --no-cache-dir gunicorn uvicorn + +# Create the final image +FROM python:3.10-slim + +WORKDIR /app + +# Copy the installed packages from the builder +COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages +COPY --from=builder /usr/local/bin /usr/local/bin + +# Copy the application and config +COPY r2r /app/r2r +COPY config.json /app/config.json + +# Expose the port +EXPOSE 8000 + +# Run the application +CMD ["uvicorn", "r2r.main.app_entry:app", "--host", "0.0.0.0", "--port", "8000"] -- cgit 1.4.1