-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (20 loc) · 904 Bytes
/
Copy pathDockerfile
File metadata and controls
26 lines (20 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Use an official Python runtime as a parent image
FROM python:3.12-slim
RUN apt-get update \
&& apt-get -y install libpq-dev gcc\
&& pip install pipenv && pip install openai
# Set the working directory in the container
WORKDIR /usr/src/app
# Copy the current directory contents into the container at /usr/src/app
COPY . .
# Install dependencies using Pipenv
# --system: Install packages into the system Python, not a virtualenv
# --deploy: Abort if the Pipfile.lock is out-of-date, or Python version is wrong
# --ignore-pipfile: Ignore the Pipfile for installation and use what's in the Pipfile.lock
RUN pipenv install --system --deploy --ignore-pipfile
# Make port 80 available to the world outside this container
EXPOSE 80
# Define environment variable
ENV PYTHONUNBUFFERED=1
# Run the application
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080", "--workers", "3"]