Skip to content

Commit

Permalink
Dockerfile: Run fastapi under non(-implicitly?-)root user
Browse files Browse the repository at this point in the history
  • Loading branch information
vpsx committed Nov 15, 2024
1 parent e534ecc commit 8fb09f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY ./main.py /code/main.py
COPY ./adminpage.html /code/adminpage.html

RUN adduser fastapi
RUN chown fastapi /code
USER fastapi

CMD ["fastapi", "run", "main.py", "--port", "8000"]

0 comments on commit 8fb09f2

Please sign in to comment.