generated from rexzhang/python-project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(container): ENTRYPOINT down to CMD for simplify entrypoint.sh &&…
… delete env DEBUG for conflict with exec
- Loading branch information
1 parent
fe91a08
commit bfb313e
Showing
2 changed files
with
30 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,35 @@ | ||
#!/bin/sh | ||
|
||
# for dev | ||
if [ "$DEBUG" = "true" ]; then exec python; fi | ||
|
||
if [ "$1" == "asgi_webdav" ]; then | ||
|
||
## set non-root user | ||
usermod -o -u "$UID" runner | ||
groupmod -o -g "$GID" runner | ||
|
||
echo " | ||
------------------------ | ||
User uid: $(id -u runner) | ||
User gid: $(id -g runner) | ||
------------------------ | ||
" | ||
|
||
echo "prepare..." | ||
chown -R runner:runner /data | ||
|
||
if [ -z "$WEBDAV_HOST" ]; then | ||
WEBDAV_HOST="0.0.0.0" | ||
fi | ||
|
||
if [ -z "$WEBDAV_PORT" ]; then | ||
WEBDAV_PORT="8000" | ||
fi | ||
|
||
if [ -z "$WEBDAV_CONFIGFILE" ]; then | ||
WEBDAV_CONFIGFILE="/data/webdav.json" | ||
fi | ||
## set non-root user | ||
usermod -o -u "$UID" runner | ||
groupmod -o -g "$GID" runner | ||
|
||
echo " | ||
------------------------ | ||
User uid: $(id -u runner) | ||
User gid: $(id -g runner) | ||
------------------------ | ||
" | ||
|
||
echo "prepare..." | ||
chown -R runner:runner /data | ||
|
||
if [ -z "$WEBDAV_HOST" ]; then | ||
WEBDAV_HOST="0.0.0.0" | ||
fi | ||
|
||
exec su-exec runner \ | ||
python -m asgi_webdav \ | ||
--host "$WEBDAV_HOST" \ | ||
--port "$WEBDAV_PORT" \ | ||
--config "$WEBDAV_CONFIGFILE" \ | ||
--logging-no-display-datetime \ | ||
--logging-no-use-colors | ||
if [ -z "$WEBDAV_PORT" ]; then | ||
WEBDAV_PORT="8000" | ||
fi | ||
|
||
if [ -z "$WEBDAV_CONFIGFILE" ]; then | ||
WEBDAV_CONFIGFILE="/data/webdav.json" | ||
fi | ||
|
||
exec $* | ||
exec su-exec runner \ | ||
python -m asgi_webdav \ | ||
--host "$WEBDAV_HOST" \ | ||
--port "$WEBDAV_PORT" \ | ||
--config "$WEBDAV_CONFIGFILE" \ | ||
--logging-no-display-datetime \ | ||
--logging-no-use-colors |