Spaces:
Sleeping
Sleeping
Refactor Dockerfile to create appuser with home directory and set permissions
Browse files- 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 |
-
|
19 |
-
|
20 |
-
|
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 |
|