srivatsavdamaraju commited on
Commit
586855e
·
verified ·
1 Parent(s): 2081f7f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -3
Dockerfile CHANGED
@@ -1,13 +1,31 @@
 
1
  FROM python:3.9-slim
 
 
2
  WORKDIR /app
 
 
3
  COPY requirements.txt ./requirements.txt
 
 
4
  RUN apt-get update \
5
  && apt-get -y install libpq-dev gcc \
6
- && pip install psycopg2
 
 
 
 
7
  # Install uvicorn
8
  RUN pip install uvicorn
9
- # Install dependencies
 
10
  RUN pip install -r requirements.txt
 
 
11
  COPY . /app
 
 
12
  ENTRYPOINT ["uvicorn", "main:app"]
13
- CMD ["--host", "0.0.0.0", "--port", "7860"]
 
 
 
1
+ # Use the official Python image as base
2
  FROM python:3.9-slim
3
+
4
+ # Set the working directory in the container
5
  WORKDIR /app
6
+
7
+ # Copy the requirements file into the container at /app
8
  COPY requirements.txt ./requirements.txt
9
+
10
+ # Install system dependencies
11
  RUN apt-get update \
12
  && apt-get -y install libpq-dev gcc \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # Install psycopg2
16
+ RUN pip install psycopg2
17
+
18
  # Install uvicorn
19
  RUN pip install uvicorn
20
+
21
+ # Install Python dependencies
22
  RUN pip install -r requirements.txt
23
+
24
+ # Copy the current directory contents into the container at /app
25
  COPY . /app
26
+
27
+ # Set the entry point for running the application with Uvicorn
28
  ENTRYPOINT ["uvicorn", "main:app"]
29
+
30
+ # Specify default command arguments for Uvicorn
31
+ CMD ["--host", "0.0.0.0", "--port", "7860"]