Skip to content

Commit

Permalink
Fix entrypoint.sh (#921)
Browse files Browse the repository at this point in the history
* Revert #864

add && make it err and skipping perm check

* Restore armv7 nightly

* Update entrypoint.sh

* simplify, always setup permission regardless uid
  • Loading branch information
martadinata666 authored May 26, 2023
1 parent 3dfdbcb commit ba0de7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64/v8
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
push: true
tags: ${{ steps.docker-meta.outputs.tags }}
labels: ${{ steps.docker-meta.outputs.labels }}
18 changes: 4 additions & 14 deletions backend/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
#!/bin/sh
#!/bin/bash
set -eu

CMD="npm start && pm2 start"

# if the first arg starts with "-" pass it to program
if [ "${1#-}" != "$1" ]; then
set -- "$CMD" "$@"
fi

# chown current working directory to current user
if [ "$*" = "$CMD" ] && [ "$(id -u)" = "0" ]; then
find . \! -user "$UID" -exec chown "$UID:$GID" -R '{}' + || echo "WARNING! Could not change directory ownership. If you manage permissions externally this is fine, otherwise you may experience issues when downloading or deleting videos."
exec gosu "$UID:$GID" "$0" "$@"
fi

exec "$@"
echo "[entrypoint] setup permission, this may take a while"
find . \! -user "$UID" -exec chown "$UID:$GID" '{}' + || echo "WARNING! Could not change directory ownership. If you manage permissions externally this is fine, otherwise you may experience issues when downloading or deleting videos."
exec gosu "$UID:$GID" "$@"

0 comments on commit ba0de7f

Please sign in to comment.