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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -26
Dockerfile CHANGED
@@ -1,38 +1,25 @@
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"]
 
 
1
  FROM python:3.11-slim
2
 
 
 
 
 
3
  WORKDIR /app
4
 
5
+ RUN apt-get update && apt-get install -y gcc
 
 
 
 
 
 
6
 
7
+ # Install deps
8
+ COPY requirements.txt .
9
+ RUN pip install --upgrade pip \
10
+ && pip install -r requirements.txt
 
 
11
 
12
+ # Copy your code
13
+ COPY . /app
14
 
15
+ # Create and set perms on application folders
16
+ RUN mkdir -p /app/cache /app/uploads /app/data /app/chats \
17
+ && chmod -R 755 /app/cache /app/uploads /app/data /app/chats \
18
+ && chmod -R 755 /app
19
 
 
20
  ENV FLASK_APP=app.py \
21
+ FLASK_ENV=production
22
 
23
  EXPOSE 7860
24
 
25
+ CMD ["gunicorn", "-k", "eventlet", "-w", "1", "-b", "0.0.0.0:7860", "--timeout", "600", "app:app"]