Spaces:
Sleeping
Sleeping
EL GHAFRAOUI AYOUB
commited on
Commit
·
75d4ea8
1
Parent(s):
48f93f0
- Dockerfile +7 -11
Dockerfile
CHANGED
@@ -10,23 +10,19 @@ COPY requirements.txt .
|
|
10 |
# Install dependencies
|
11 |
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
|
|
|
|
|
|
|
13 |
# Create data directory with proper permissions
|
14 |
RUN mkdir -p /app/data && \
|
15 |
-
chown -R
|
16 |
-
|
|
|
|
|
17 |
|
18 |
# Copy the rest of the application
|
19 |
COPY . .
|
20 |
|
21 |
-
# Set permissions for the database file
|
22 |
-
RUN touch /app/data/sql_app.db && \
|
23 |
-
chmod 666 /app/data/sql_app.db && \
|
24 |
-
chown root:root /app/data/sql_app.db
|
25 |
-
|
26 |
-
# Create a non-root user
|
27 |
-
RUN useradd -m myuser
|
28 |
-
USER myuser
|
29 |
-
|
30 |
# Expose port
|
31 |
EXPOSE 8000
|
32 |
|
|
|
10 |
# Install dependencies
|
11 |
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
|
13 |
+
# Create a non-root user
|
14 |
+
RUN useradd -m myuser
|
15 |
+
|
16 |
# Create data directory with proper permissions
|
17 |
RUN mkdir -p /app/data && \
|
18 |
+
chown -R myuser:myuser /app/data
|
19 |
+
|
20 |
+
# Switch to the non-root user
|
21 |
+
USER myuser
|
22 |
|
23 |
# Copy the rest of the application
|
24 |
COPY . .
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
# Expose port
|
27 |
EXPOSE 8000
|
28 |
|