Skip to content

Commit

Permalink
Add & use nonroot user to fix a security hotspot
Browse files Browse the repository at this point in the history
  • Loading branch information
IbraheemTuffaha committed Jul 13, 2024
1 parent d42df69 commit c092f7e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ COPY --from=build /tmp/requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY ./app /code/app

RUN groupadd -r nonroot && useradd -r -g nonroot nonroot
USER nonroot

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

0 comments on commit c092f7e

Please sign in to comment.