Perilon commited on
Commit
0f524ec
·
1 Parent(s): 2a70b45

Fix permissions in Dockerfile for git config

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -3
Dockerfile CHANGED
@@ -5,14 +5,22 @@ WORKDIR /app
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
- COPY . .
9
-
10
- # Make sure ffmpeg and wget are installed
11
  RUN apt-get update && apt-get install -y ffmpeg wget git && apt-get clean
 
12
 
13
  # Set environment variables
14
  ENV PYTHONUNBUFFERED=1
15
  ENV PORT=7860
 
 
 
 
 
 
 
 
16
 
17
  # Expose the port the app runs on
18
  EXPOSE 7860
 
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
+ # Create a user for running the app
9
+ RUN useradd -m -u 1000 user
 
10
  RUN apt-get update && apt-get install -y ffmpeg wget git && apt-get clean
11
+ RUN mkdir -p /home/user && chown -R user:user /home/user
12
 
13
  # Set environment variables
14
  ENV PYTHONUNBUFFERED=1
15
  ENV PORT=7860
16
+ ENV HOME=/home/user
17
+
18
+ # Copy app files
19
+ COPY . .
20
+ RUN chown -R user:user /app
21
+
22
+ # Switch to non-root user
23
+ USER user
24
 
25
  # Expose the port the app runs on
26
  EXPOSE 7860