-
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
Showing
1 changed file
with
15 additions
and
1 deletion.
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,11 +1,25 @@ | ||
# Use the official Python 3.12 slim image | ||
FROM python:3.12-slim | ||
|
||
# Set the working directory | ||
WORKDIR /code | ||
|
||
# Set environment variable to prevent Python from buffering stdout and stderr | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# Add Debian repository for additional packages | ||
RUN echo "deb https://deb.debian.org/debian/ stable main" > /etc/apt/sources.list | ||
|
||
COPY requirements.txt /code/app/requirements.txt | ||
# Install necessary system packages | ||
RUN apt-get update \ | ||
&& apt-get -y install libpq-dev swig vim gcc libssl-dev | ||
|
||
# Copy and install Python dependencies | ||
COPY ./requirements.txt /code/app/requirements.txt | ||
RUN pip install --no-cache-dir --upgrade -r /code/app/requirements.txt | ||
|
||
# Copy the application code | ||
COPY . /code/app | ||
|
||
# Set the default command to run the application | ||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"] |