Spaces:
Running
Running
Commit
·
96f83bf
1
Parent(s):
890b0ad
Refactor Dockerfile: reorganize file copying to prioritize model files, add necessary directory creation upfront, and enhance debug verification for copied models.
Browse files- Dockerfile +15 -8
Dockerfile
CHANGED
@@ -16,21 +16,28 @@ RUN apt-get update && apt-get install -y \
|
|
16 |
ffmpeg \
|
17 |
&& rm -rf /var/lib/apt/lists/*
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
# Copy requirements first to leverage Docker cache
|
20 |
COPY requirements.txt .
|
21 |
RUN pip install --no-cache-dir -r requirements.txt
|
22 |
|
23 |
-
# Copy
|
24 |
-
COPY .
|
|
|
25 |
|
26 |
-
#
|
27 |
RUN ls -la /app/app/models
|
28 |
-
# ----------------------------------------
|
29 |
|
30 |
-
#
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
34 |
# Create app user
|
35 |
useradd -m -u 1000 app && \
|
36 |
# Set ownership of all files and directories
|
|
|
16 |
ffmpeg \
|
17 |
&& rm -rf /var/lib/apt/lists/*
|
18 |
|
19 |
+
# Create necessary directories first
|
20 |
+
RUN mkdir -p /app/app/models \
|
21 |
+
/app/storage/audio \
|
22 |
+
/app/storage/text \
|
23 |
+
/app/storage/temp
|
24 |
+
|
25 |
# Copy requirements first to leverage Docker cache
|
26 |
COPY requirements.txt .
|
27 |
RUN pip install --no-cache-dir -r requirements.txt
|
28 |
|
29 |
+
# Copy models files first to ensure they exist
|
30 |
+
COPY app/models/database.py app/models/
|
31 |
+
COPY app/models/__init__.py app/models/
|
32 |
|
33 |
+
# Debug: Verify models files were copied
|
34 |
RUN ls -la /app/app/models
|
|
|
35 |
|
36 |
+
# Copy the rest of the application code
|
37 |
+
COPY . .
|
38 |
+
|
39 |
+
# Set up permissions
|
40 |
+
RUN chmod +x /app/scripts/run.sh && \
|
41 |
# Create app user
|
42 |
useradd -m -u 1000 app && \
|
43 |
# Set ownership of all files and directories
|