mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 02:03:35 -04:00 
			
		
		
		
	fix: re-enable change user and fix SIGTERM (#2882)
* re-enable change user * fix gosu and close #2723
This commit is contained in:
		| @@ -138,4 +138,4 @@ EXPOSE ${APP_PORT} | |||||||
| COPY ./docker/entry.sh $MEALIE_HOME/run.sh | COPY ./docker/entry.sh $MEALIE_HOME/run.sh | ||||||
|  |  | ||||||
| RUN chmod +x $MEALIE_HOME/run.sh | RUN chmod +x $MEALIE_HOME/run.sh | ||||||
| ENTRYPOINT $MEALIE_HOME/run.sh | ENTRYPOINT ["/app/run.sh"] | ||||||
|   | |||||||
| @@ -1,13 +1,10 @@ | |||||||
| # Start Backend API |  | ||||||
| #!/bin/bash | #!/bin/bash | ||||||
|  | # Start Backend API | ||||||
| # Strict Mode |  | ||||||
| # set -e |  | ||||||
| # IFS=$'\n\t' |  | ||||||
|  |  | ||||||
| # Get PUID/PGID | # Get PUID/PGID | ||||||
| PUID=${PUID:-911} | PUID=${PUID:-911} | ||||||
| PGID=${PGID:-911} | PGID=${PGID:-911} | ||||||
|  | BASH_SOURCE=${BASH_SOURCE:-$0} | ||||||
|  |  | ||||||
| add_user() { | add_user() { | ||||||
|     groupmod -o -g "$PGID" abc |     groupmod -o -g "$PGID" abc | ||||||
| @@ -22,7 +19,7 @@ change_user() { | |||||||
|  |  | ||||||
|         echo "Switching to dedicated user" |         echo "Switching to dedicated user" | ||||||
|         exec gosu $PUID "$BASH_SOURCE" "$@" |         exec gosu $PUID "$BASH_SOURCE" "$@" | ||||||
|         elif [ "$(id -u)" = $PUID ]; then |     elif [ "$(id -u)" = $PUID ]; then | ||||||
|         echo " |         echo " | ||||||
|         User uid:    $PUID |         User uid:    $PUID | ||||||
|         User gid:    $PGID |         User gid:    $PGID | ||||||
| @@ -41,7 +38,7 @@ init() { | |||||||
|     poetry run python /app/mealie/db/init_db.py |     poetry run python /app/mealie/db/init_db.py | ||||||
| } | } | ||||||
|  |  | ||||||
| # change_user | change_user | ||||||
| init | init | ||||||
| GUNICORN_PORT=${API_PORT:-9000} | GUNICORN_PORT=${API_PORT:-9000} | ||||||
|  |  | ||||||
| @@ -49,7 +46,7 @@ GUNICORN_PORT=${API_PORT:-9000} | |||||||
| hostip=`/sbin/ip route|awk '/default/ { print $3 }'` | hostip=`/sbin/ip route|awk '/default/ { print $3 }'` | ||||||
| if [ "$WEB_GUNICORN" = 'true' ]; then | if [ "$WEB_GUNICORN" = 'true' ]; then | ||||||
|     echo "Starting Gunicorn" |     echo "Starting Gunicorn" | ||||||
|     gunicorn mealie.app:app -b 0.0.0.0:$GUNICORN_PORT --forwarded-allow-ips=$hostip -k uvicorn.workers.UvicornWorker -c /app/gunicorn_conf.py --preload |     exec gunicorn mealie.app:app -b 0.0.0.0:$GUNICORN_PORT --forwarded-allow-ips=$hostip -k uvicorn.workers.UvicornWorker -c /app/gunicorn_conf.py --preload | ||||||
| else | else | ||||||
|     uvicorn mealie.app:app --host 0.0.0.0 --forwarded-allow-ips=$hostip --port $GUNICORN_PORT |     exec uvicorn mealie.app:app --host 0.0.0.0 --forwarded-allow-ips=$hostip --port $GUNICORN_PORT | ||||||
| fi | fi | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user