Spaces:
Sleeping
Sleeping
Commit
·
09508f5
1
Parent(s):
f08f6c6
Refactor Dockerfile: streamline user creation and permissions setup, ensure run script is executable, and improve directory structure for application storage.
Browse files- Dockerfile +6 -9
Dockerfile
CHANGED
@@ -17,10 +17,6 @@ RUN apt-get update && apt-get install -y \
|
|
17 |
ffmpeg \
|
18 |
&& rm -rf /var/lib/apt/lists/*
|
19 |
|
20 |
-
# Create app user
|
21 |
-
RUN useradd -m -u 1000 app && \
|
22 |
-
chown -R app:app /app
|
23 |
-
|
24 |
# Copy requirements file
|
25 |
COPY requirements.txt .
|
26 |
|
@@ -30,16 +26,17 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
30 |
# Copy application code
|
31 |
COPY . .
|
32 |
|
33 |
-
# Create necessary directories
|
34 |
RUN mkdir -p /app/storage/audio /app/storage/text /app/storage/temp && \
|
35 |
-
|
|
|
|
|
|
|
|
|
36 |
|
37 |
# Switch to app user
|
38 |
USER app
|
39 |
|
40 |
-
# Make run script executable
|
41 |
-
RUN chmod +x scripts/run.sh
|
42 |
-
|
43 |
# Expose port
|
44 |
EXPOSE 7860
|
45 |
|
|
|
17 |
ffmpeg \
|
18 |
&& rm -rf /var/lib/apt/lists/*
|
19 |
|
|
|
|
|
|
|
|
|
20 |
# Copy requirements file
|
21 |
COPY requirements.txt .
|
22 |
|
|
|
26 |
# Copy application code
|
27 |
COPY . .
|
28 |
|
29 |
+
# Create necessary directories and set permissions
|
30 |
RUN mkdir -p /app/storage/audio /app/storage/text /app/storage/temp && \
|
31 |
+
# Make run script executable before changing ownership
|
32 |
+
chmod +x /app/scripts/run.sh && \
|
33 |
+
# Create app user and set ownership
|
34 |
+
useradd -m -u 1000 app && \
|
35 |
+
chown -R app:app /app
|
36 |
|
37 |
# Switch to app user
|
38 |
USER app
|
39 |
|
|
|
|
|
|
|
40 |
# Expose port
|
41 |
EXPOSE 7860
|
42 |
|