DevForML commited on
Commit
038b80c
·
verified ·
1 Parent(s): abbf954

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -27
Dockerfile CHANGED
@@ -1,28 +1,38 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.11-slim
3
-
4
- # Install system dependencies
5
- RUN apt-get update && apt-get install -y gcc
6
-
7
- # Set the working directory to /app
8
- WORKDIR /app
9
-
10
- # Copy the requirements file and install dependencies
11
- COPY requirements.txt .
12
- RUN pip install --upgrade pip && pip install -r requirements.txt
13
-
14
- # Create necessary directories with appropriate permissions
15
- RUN mkdir -p /app/cache /app/uploads /app/data /app/chats && chmod -R 777 /app/cache /app/uploads /app/data /app/chats
16
- RUN chmod -R 777 /app
17
-
18
- # Copy the application code
19
- COPY . .
20
-
21
- # Set environment variables
22
- ENV FLASK_APP=app.py \
23
- FLASK_ENV=production
24
-
25
- EXPOSE 7860
26
-
27
- # Run the application using Gunicorn
 
 
 
 
 
 
 
 
 
 
28
  CMD ["gunicorn", "-k", "eventlet", "-w", "1", "-b", "0.0.0.0:7860", "--timeout", "600", "app:app"]
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.11-slim
3
+
4
+ # Install system dependencies
5
+ RUN apt-get update && apt-get install -y gcc
6
+
7
+ # Set the working directory to /app
8
+ WORKDIR /app
9
+
10
+ # Copy the requirements file and install dependencies
11
+ COPY requirements.txt .
12
+ RUN pip install --upgrade pip && pip install -r requirements.txt
13
+
14
+ # Create necessary directories with appropriate permissions
15
+ RUN mkdir -p /app/cache /app/uploads /app/data /app/chats && chmod -R 777 /app/cache /app/uploads /app/data /app/chats
16
+ RUN chmod -R 777 /app
17
+
18
+ # Ensure all relevant directories have the correct permissions
19
+ RUN chmod -R 777 /app/cache
20
+ RUN chmod -R 777 /app/data
21
+ RUN chmod -R 777 /app/uploads
22
+ RUN chmod -R 777 /app/chats
23
+ RUN chmod -R 777 /app
24
+
25
+ # Copy the rest of the application code to /app
26
+ COPY . /app/
27
+
28
+ # Copy the application code
29
+ COPY . .
30
+
31
+ # Set environment variables
32
+ ENV FLASK_APP=app.py \
33
+ FLASK_ENV=production
34
+
35
+ EXPOSE 7860
36
+
37
+ # Run the application using Gunicorn
38
  CMD ["gunicorn", "-k", "eventlet", "-w", "1", "-b", "0.0.0.0:7860", "--timeout", "600", "app:app"]