Skip to content

Commit

Permalink
ci: add default nonroot user
Browse files Browse the repository at this point in the history
  • Loading branch information
farioas committed Nov 10, 2022
1 parent 2836280 commit 5734cdb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,7 @@ ENV HOME=/label-studio

EXPOSE 8080

USER 1001

ENTRYPOINT ["./deploy/docker-entrypoint.sh"]
CMD ["label-studio"]
10 changes: 0 additions & 10 deletions deploy/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ exec 3>&1

ENTRYPOINT_PATH=/label-studio/deploy/docker-entrypoint.d

uid_entrypoint() {
if ! whoami 2>/dev/null; then
if [ -w /etc/passwd ]; then
echo "labelstudio::$(id -u):0:labelstudio user:${HOME}:/bin/bash" >>/etc/passwd
fi
fi
}

exec_entrypoint() {
if /usr/bin/find -L "$1" -mindepth 1 -maxdepth 1 -type f -print -quit 2>/dev/null | read v; then
echo >&3 "$0: Looking for init scripts in $1"
Expand All @@ -41,8 +33,6 @@ exec_entrypoint() {
fi
}

uid_entrypoint

if [ "$1" = "nginx" ]; then
# in this mode we're running in a separate container
export APP_HOST=${APP_HOST:=app}
Expand Down

0 comments on commit 5734cdb

Please sign in to comment.