Akane710 commited on
Commit
fcfa4c7
·
verified ·
1 Parent(s): 793ddd1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -3
Dockerfile CHANGED
@@ -28,11 +28,19 @@ RUN apt-get update && \
28
  ENV PORT=7860
29
  ENV PIPENV_VENV_IN_PROJECT=1
30
 
31
- # Set working directory
 
 
 
 
32
  WORKDIR /app
 
 
 
 
33
 
34
- # Copy application files
35
- COPY . .
36
 
37
  # Expose the application port
38
  EXPOSE 7860
 
28
  ENV PORT=7860
29
  ENV PIPENV_VENV_IN_PROJECT=1
30
 
31
+ # Create a non-root user and group
32
+ RUN groupadd -g 1000 appuser && \
33
+ useradd -m -u 1000 -g appuser appuser
34
+
35
+ # Set the working directory and adjust permissions
36
  WORKDIR /app
37
+ RUN chown -R appuser:appuser /app
38
+
39
+ # Switch to the non-root user
40
+ USER appuser
41
 
42
+ # Copy application code
43
+ COPY --chown=appuser:appuser . .
44
 
45
  # Expose the application port
46
  EXPOSE 7860