navindusa commited on
Commit
f919051
·
1 Parent(s): ed21419

Refactor Dockerfile to create appuser with home directory and set permissions

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -9
Dockerfile CHANGED
@@ -15,15 +15,9 @@ FROM python:${PYTHON_VERSION}-slim as base
15
  # the application crashes without emitting any logs due to buffering.
16
  ENV PYTHONUNBUFFERED=1
17
 
18
- ARG UID=10001
19
- RUN adduser \
20
- --disabled-password \
21
- --gecos "" \
22
- --home "/nonexistent" \
23
- --shell "/sbin/nologin" \
24
- --no-create-home \
25
- --uid "${UID}" \
26
- appuser
27
 
28
  USER appuser
29
 
 
15
  # the application crashes without emitting any logs due to buffering.
16
  ENV PYTHONUNBUFFERED=1
17
 
18
+ RUN useradd -m -s /bin/bash appuser && \
19
+ # Give necessary permissions
20
+ chown -R appuser:appuser /app
 
 
 
 
 
 
21
 
22
  USER appuser
23