use_uid
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -1,7 +1,12 @@
|
|||||||
FROM python:3.11-slim
|
FROM python:3.11-slim
|
||||||
|
|
||||||
# Create a non-root user for security
|
|
||||||
RUN groupadd -g 1000 flaskuser && useradd -u 1000 -g flaskuser flaskuser
|
ARG USER_UID=1000
|
||||||
|
ARG USER_GID=1000
|
||||||
|
|
||||||
|
# --build-arg USER_GID= USER_UID=
|
||||||
|
RUN groupadd -g "${USER_GID}" flaskuser \
|
||||||
|
&& useradd -u "${USER_UID}" -g "${USER_GID}" flaskuser
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -17,4 +22,4 @@ RUN chown -R flaskuser:flaskuser /app
|
|||||||
USER flaskuser
|
USER flaskuser
|
||||||
|
|
||||||
# Run with Gunicorn (replaces uwsgi)
|
# Run with Gunicorn (replaces uwsgi)
|
||||||
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app", "--workers", "4"]
|
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app", "--workers", "4"]
|
||||||
|
|||||||
2
content
2
content
Submodule content updated: f9d6a2d1ea...d0e3035242
Reference in New Issue
Block a user