Skip to content

Commit

Permalink
simplify prod dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
liberty-rising committed Jan 9, 2024
1 parent 248ae95 commit 396771c
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions backend/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 396771c

Please sign in to comment.