-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
248ae95
commit 396771c
Showing
1 changed file
with
4 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |