acecalisto3 commited on
Commit
ec74b37
·
verified ·
1 Parent(s): 87e5f9e

Update DOCKERFILE

Browse files
Files changed (1) hide show
  1. DOCKERFILE +23 -14
DOCKERFILE CHANGED
@@ -1,24 +1,33 @@
1
- # Use the official Python image as a base
2
- FROM python:3.9-slim
3
 
4
- # Set the working directory to /app
 
 
 
 
5
  WORKDIR /app
6
 
7
- # Copy the requirements file into the working directory
8
- COPY requirements.txt .
 
 
 
 
 
9
 
10
- # Install the dependencies
11
- RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Install the spacy library and download the en_core_web_sm model
14
- RUN pip install spacy
15
- RUN python -m spacy download en_core_web_sm
16
 
17
- # Copy the application code into the working directory
18
  COPY . .
19
 
20
- # Expose the port that the application will use
21
- EXPOSE 8000
22
 
23
- # Run the command to start the application when the container is launched
24
  CMD ["python", "app.py"]
 
1
+ # Use an official Python runtime as the base image
2
+ FROM python:3.10-slim
3
 
4
+ # Set environment variables
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
7
+
8
+ # Set the working directory in the container
9
  WORKDIR /app
10
 
11
+ # Install system dependencies
12
+ RUN apt-get update && apt-get install -y \
13
+ build-essential \
14
+ libssl-dev \
15
+ libffi-dev \
16
+ python3-dev \
17
+ && rm -rf /var/lib/apt/lists/*
18
 
19
+ # Copy the requirements file into the container
20
+ COPY requirements.txt .
21
 
22
+ # Upgrade pip and install Python dependencies
23
+ RUN pip install --upgrade pip
24
+ RUN pip install -r requirements.txt
25
 
26
+ # Copy the rest of the application code into the container
27
  COPY . .
28
 
29
+ # Expose the port your app runs on (adjust if necessary)
30
+ EXPOSE 7860
31
 
32
+ # Define the command to run the application
33
  CMD ["python", "app.py"]