File size: 4,069 Bytes
6cbb46c
 
6c70c16
6cbb46c
 
6c70c16
6cbb46c
 
6c70c16
6cbb46c
 
6c70c16
6cbb46c
 
6c70c16
6cbb46c
 
6c70c16
6cbb46c
 
6c70c16
6cbb46c
 
 
 
6c70c16
6cbb46c
 
6c70c16
6cbb46c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6c70c16
 
 
 
faa4c32
0d64ea6
 
 
 
 
 
 
 
627a1e0
 
 
51c3db1
 
 
 
 
 
c32b3bf
 
51c3db1
 
34a4e07
c32b3bf
faa4c32
c606ee0
53b96bd
e79c88b
208e09a
c32b3bf
c606ee0
0d64ea6
53b96bd
9d092ae
0d64ea6
0a4189b
faa4c32
0a4189b
 
 
 
0d64ea6
627a1e0
0d64ea6
 
6cbb46c
 
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# # # # Use the official Python image from the Docker Hub
# # # FROM python:3.10.0-slim-buster

# # # # Set the working directory in the container
# # # WORKDIR /app

# # # # Copy the current directory contents into the container at /app
# # # COPY . /app

# # # # Upgrade pip to the latest version
# # # RUN pip install --upgrade pip

# # # # Install any needed packages specified in requirements.txt
# # # RUN pip install --no-cache-dir -r requirements.txt

# # # # Create directories for NLTK and Hugging Face cache data
# # # RUN mkdir -p /app/nltk_data /app/.cache/huggingface /app/.huggingface_cache

# # # # Download NLTK data (punkt and wordnet)
# # # RUN python -m nltk.downloader -d /app/nltk_data punkt wordnet

# # # # Set environment variables
# # # ENV NLTK_DATA=/app/nltk_data
# # # ENV HF_HOME=/app/.huggingface_cache
# # # ENV TRANSFORMERS_CACHE=/app/.huggingface_cache

# # # # Change ownership of directories to the non-root user
# # # RUN chown -R nobody:nogroup /app/nltk_data /app/.huggingface_cache /app

# # # # Switch to a non-root user
# # # USER nobody

# # # # Make port 7860 available to the world outside this container
# # # EXPOSE 7860

# # # # Command to run the application
# # # CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]


# # Use the official Python image from the Docker Hub
# FROM python:3.10.0-slim-buster

# # Set the working directory in the container
# WORKDIR /app

# # Copy the current directory contents into the container at /app
# COPY . /app

# # Upgrade pip to the latest version
# RUN pip install --upgrade pip

# # Install build essentials and gfortran
# RUN apt-get update && apt-get install -y \
#     build-essential \
#     gfortran \
#     && rm -rf /var/lib/apt/lists/*

# # Install any needed packages specified in requirements.txt
# RUN pip install --no-cache-dir -r requirements.txt

# # Install NumPy version 1.21.0
# RUN pip install --no-cache-dir numpy==1.21.0

# # Create directories for NLTK and Hugging Face cache data
# RUN mkdir -p /app/nltk_data /app/.cache/huggingface /app/.huggingface_cache

# # Download NLTK data (punkt and wordnet)
# RUN python -m nltk.downloader -d /app/nltk_data punkt wordnet

# # Set environment variables
# ENV NLTK_DATA=/app/nltk_data
# ENV HF_HOME=/app/.huggingface_cache
# ENV TRANSFORMERS_CACHE=/app/.huggingface_cache

# # Change ownership of directories to the non-root user
# RUN chown -R nobody:nogroup /app/nltk_data /app/.huggingface_cache /app

# # Switch to a non-root user
# USER nobody

# # Make port 7860 available to the world outside this container
# EXPOSE 7860

# # Command to run the application
# CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]




# Use the official Python image from the Docker Hub
FROM python:3.10.0-slim-buster

# Set the working directory in the container
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Upgrade pip to the latest version
RUN pip install --upgrade pip

# Install build essentials and gfortran
RUN apt-get update && apt-get install -y \
    build-essential \
    gfortran \
    && rm -rf /var/lib/apt/lists/*

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Install NumPy version 1.21.0
RUN pip install --no-cache-dir numpy==1.21.0

# Create directories for NLTK and Hugging Face cache data
RUN mkdir -p /app/nltk_data /app/.cache/huggingface /app/.huggingface_cache

# Download NLTK data (punkt and wordnet)
RUN python -m nltk.downloader -d /app/nltk_data punkt wordnet

# Set environment variables
ENV NLTK_DATA=/app/nltk_data
ENV HF_HOME=/app/.huggingface_cache
ENV TRANSFORMERS_CACHE=/app/.huggingface_cache

# Change ownership of directories to the non-root user
RUN chown -R nobody:nogroup /app/nltk_data /app/.huggingface_cache /app

# Switch to a non-root user
USER nobody

# Make port 7860 available to the world outside this container
EXPOSE 7860

# Command to run the application
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "2", "--timeout", "120", "app:app"]