sanch1txp commited on
Commit
656d427
·
verified ·
1 Parent(s): 131c1fe

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -2
Dockerfile CHANGED
@@ -1,14 +1,24 @@
1
  FROM python:3.10
2
 
 
3
  WORKDIR /app
4
 
5
- # Cache pip install if requirements.txt doesn't change
6
  COPY requirements.txt .
7
  RUN pip install --no-cache-dir -r requirements.txt
8
 
9
- # Copy rest of the code
10
  COPY . .
11
 
 
 
 
 
 
 
 
 
12
  EXPOSE 7860
13
 
 
14
  CMD ["python", "app.py"]
 
1
  FROM python:3.10
2
 
3
+ # Set working directory
4
  WORKDIR /app
5
 
6
+ # Copy and install dependencies
7
  COPY requirements.txt .
8
  RUN pip install --no-cache-dir -r requirements.txt
9
 
10
+ # Copy all code
11
  COPY . .
12
 
13
+ # Create required folders with open permissions
14
+ RUN mkdir -p /data/generated /app/generated /tmp /var/tmp && \
15
+ chmod -R 777 /data /app/generated /tmp /var/tmp /app
16
+
17
+ # Set user as root to avoid permission errors
18
+ USER root
19
+
20
+ # Expose port for Flask
21
  EXPOSE 7860
22
 
23
+ # Run Flask app
24
  CMD ["python", "app.py"]