Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -9
Dockerfile
CHANGED
@@ -4,17 +4,16 @@ FROM python:3.11-slim
|
|
4 |
# Set working directory inside the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
# Create a non-root user
|
8 |
-
# UID 1000 is commonly used in Spaces, but this may vary
|
9 |
RUN useradd -m -u 1000 appuser
|
10 |
|
11 |
-
# Create the saved_models directory
|
12 |
RUN mkdir -p /app/saved_models && chown -R appuser:appuser /app
|
13 |
|
14 |
-
# Copy requirements.txt
|
15 |
COPY requirements.txt .
|
16 |
|
17 |
-
# Install system dependencies
|
18 |
RUN apt-get update && apt-get install -y \
|
19 |
build-essential \
|
20 |
libatlas-base-dev \
|
@@ -24,16 +23,16 @@ RUN apt-get update && apt-get install -y \
|
|
24 |
# Install Python dependencies
|
25 |
RUN pip install --no-cache-dir -r requirements.txt
|
26 |
|
27 |
-
# Copy the entire application code
|
28 |
COPY . .
|
29 |
|
30 |
-
# Set ownership
|
31 |
RUN chown -R appuser:appuser /app
|
32 |
|
33 |
-
# Switch to
|
34 |
USER appuser
|
35 |
|
36 |
-
# Expose
|
37 |
EXPOSE 7860
|
38 |
|
39 |
# Command to run the Flask app
|
|
|
4 |
# Set working directory inside the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Create a non-root user
|
|
|
8 |
RUN useradd -m -u 1000 appuser
|
9 |
|
10 |
+
# Create the saved_models directory
|
11 |
RUN mkdir -p /app/saved_models && chown -R appuser:appuser /app
|
12 |
|
13 |
+
# Copy requirements.txt
|
14 |
COPY requirements.txt .
|
15 |
|
16 |
+
# Install system dependencies
|
17 |
RUN apt-get update && apt-get install -y \
|
18 |
build-essential \
|
19 |
libatlas-base-dev \
|
|
|
23 |
# Install Python dependencies
|
24 |
RUN pip install --no-cache-dir -r requirements.txt
|
25 |
|
26 |
+
# Copy the entire application code
|
27 |
COPY . .
|
28 |
|
29 |
+
# Set ownership
|
30 |
RUN chown -R appuser:appuser /app
|
31 |
|
32 |
+
# Switch to non-root user
|
33 |
USER appuser
|
34 |
|
35 |
+
# Expose port
|
36 |
EXPOSE 7860
|
37 |
|
38 |
# Command to run the Flask app
|