Skip to content

Commit

Permalink
Merge 1d47123 into 72e5615
Browse files Browse the repository at this point in the history
  • Loading branch information
maxfortun committed Feb 28, 2023
2 parents 72e5615 + 1d47123 commit 42755f8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
!LICENSE.txt
!README.md
!tokendito/*.py
!docker-entrypoint.sh
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ WORKDIR /app

# Creates a non-root user with an explicit UID and adds permission to access the /app folder
RUN adduser -u 5678 --disabled-password --gecos "" tokendito && chown -R tokendito /app
USER tokendito

ENTRYPOINT ["python", "tokendito/tokendito.py"]
ENTRYPOINT [ "/app/docker-entrypoint.sh" ]
7 changes: 7 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/ash -e

files="/home/tokendito/.aws/config /home/tokendito/.aws/credentials /home/tokendito/.config/tokendito/tokendito.ini"
stat -c "chown %u:%g %n" $files > /tmp/$$.restore
chown tokendito:tokendito $files
su tokendito -c "python tokendito/tokendito.py $*"
. /tmp/$$.restore

0 comments on commit 42755f8

Please sign in to comment.