Prat0 commited on
Commit
a41b07f
·
verified ·
1 Parent(s): 2f825e9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -10
Dockerfile CHANGED
@@ -1,4 +1,3 @@
1
- # Use the official Python image as a base
2
  FROM python:3.9-slim
3
 
4
  # Install necessary system dependencies
@@ -9,23 +8,24 @@ RUN apt-get update && apt-get install -y \
9
  libssl-dev \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # Set environment variables
13
- ENV PYTHONUNBUFFERED=1
14
 
15
- # Create and set the working directory
 
 
 
16
  WORKDIR /app
17
 
18
- # Copy the requirements file first to leverage Docker cache
19
  COPY requirements.txt ./
20
-
21
- # Install Python dependencies
22
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
23
 
24
- # Copy the application code to the container
25
  COPY . .
26
 
27
- # Expose the port that FastAPI will run on
28
  EXPOSE 7860
29
 
30
- # Command to run the FastAPI application with Uvicorn
31
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.9-slim
2
 
3
  # Install necessary system dependencies
 
8
  libssl-dev \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Create a directory for NLTK data
12
+ RUN mkdir -p /app/nltk_data
13
 
14
+ # Set environment variable for NLTK data
15
+ ENV NLTK_DATA=/app/nltk_data
16
+
17
+ # Set the working directory
18
  WORKDIR /app
19
 
20
+ # Copy requirements and install dependencies
21
  COPY requirements.txt ./
 
 
22
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
23
 
24
+ # Copy the application code
25
  COPY . .
26
 
27
+ # Expose port
28
  EXPOSE 7860
29
 
30
+ # Command to run the FastAPI application
31
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]