celik-muhammed commited on
Commit
db0584b
·
verified ·
1 Parent(s): dffd606

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -10
Dockerfile CHANGED
@@ -20,25 +20,25 @@ RUN apt-get update && apt-get install -y \
20
  graphviz \
21
  && rm -rf /var/lib/apt/lists/*
22
 
23
- # Create a non-root user
24
- RUN useradd --create-home --shell /bin/bash appuser
 
 
25
 
26
- # Switch to non-root user
27
- USER appuser
 
28
 
29
  # Set working directory inside container
30
  WORKDIR /app
31
 
32
- # Copy source and requirements (ownership already belongs to appuser)
33
- COPY --chown=appuser:appuser requirements.txt ./
34
- COPY --chown=appuser:appuser src/ ./src/
35
 
36
  # Install Python dependencies
37
  RUN pip install --no-cache-dir --user -r requirements.txt
38
 
39
- # Update PATH to include user base binary directory
40
- ENV PATH="/home/appuser/.local/bin:${PATH}"
41
-
42
  # Expose port
43
  EXPOSE 8501
44
 
 
20
  graphviz \
21
  && rm -rf /var/lib/apt/lists/*
22
 
23
+ # switch to a user that works for spaces
24
+ # RUN useradd --create-home --uid 1000 --shell /bin/bash user
25
+ RUN useradd -m -u 1000 -s /bin/bash user
26
+ USER user
27
 
28
+ # Update PATH to include user base binary directory
29
+ ENV HOME=/home/user \
30
+ PATH="/home/user/.local/bin:${PATH}"
31
 
32
  # Set working directory inside container
33
  WORKDIR /app
34
 
35
+ # Copy source and requirements (ownership already belongs to user)
36
+ COPY --chown=user:user requirements.txt ./
37
+ COPY --chown=1000 src/ ./src/
38
 
39
  # Install Python dependencies
40
  RUN pip install --no-cache-dir --user -r requirements.txt
41
 
 
 
 
42
  # Expose port
43
  EXPOSE 8501
44