From 396771cac21522abc37c72ccc3a06b28b56dbd9f Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Tue, 9 Jan 2024 20:04:42 +0100 Subject: [PATCH] simplify prod dockerfile --- backend/Dockerfile.prod | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/backend/Dockerfile.prod b/backend/Dockerfile.prod index 03ed1ed..35ee424 100644 --- a/backend/Dockerfile.prod +++ b/backend/Dockerfile.prod @@ -1,33 +1,19 @@ -# Build Stage -FROM python:3.9-slim-buster as builder +FROM python:3.9-slim-buster WORKDIR /app/backend +# Copy the application files COPY . /app/backend -# Install curl, postgres client, and build-essential +# Install required system dependencies RUN apt-get update && \ - apt-get install -y curl postgresql-client build-essential && \ + apt-get install -y curl postgresql-client build-essential poppler-utils && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* # Install Python packages RUN pip install --trusted-host pypi.python.org -r requirements.txt -# Final Stage -FROM python:3.9-slim-buster - -WORKDIR /app/backend - -# Copy from builder -COPY --from=builder /app/backend /app/backend - -# Install curl, postgres client, build-essential, and poppler-utils -RUN apt-get update && \ - apt-get install -y curl postgresql-client build-essential poppler-utils && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - EXPOSE 8000 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]