amaye15 commited on
Commit
517c4f8
·
1 Parent(s): e049f8a
Files changed (1) hide show
  1. Dockerfile +9 -0
Dockerfile CHANGED
@@ -9,9 +9,18 @@ FROM python:3.12-slim
9
  ENV PYTHONDONTWRITEBYTECODE 1
10
  ENV PYTHONUNBUFFERED 1
11
 
 
 
 
 
 
 
12
  # 3. Set the working directory inside the container
13
  WORKDIR /app
14
 
 
 
 
15
  # 4. Copy only the requirements file first to leverage Docker cache
16
  COPY requirements.txt .
17
 
 
9
  ENV PYTHONDONTWRITEBYTECODE 1
10
  ENV PYTHONUNBUFFERED 1
11
 
12
+ # Create a non-root user and group
13
+ ARG UID=1000
14
+ ARG GID=1000
15
+ RUN groupadd -g ${GID} --system appgroup && useradd -u ${UID} -g appgroup --system appuser
16
+
17
+
18
  # 3. Set the working directory inside the container
19
  WORKDIR /app
20
 
21
+ # Create data directory and set permissions
22
+ RUN mkdir /app/data && chown appuser:appgroup /app/data
23
+
24
  # 4. Copy only the requirements file first to leverage Docker cache
25
  COPY requirements.txt .
26