Skip to content

Commit

Permalink
chore: update docker-entrypoint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jamebal committed Jun 23, 2024
1 parent c394827 commit c97d69e
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@
set -e

USER_UID=${PUID:-0}
USER_GID=${PGID:-0}

# 创建用户组和用户,并将其 UID 和 GID 设置为环境变量指定的值
if ! getent group appgroup > /dev/null 2>&1; then
groupadd -g $USER_GID appgroup || true
fi
chown -R "${USER_UID}" /jmalcloud

if ! id -u appuser > /dev/null 2>&1; then
useradd -m -u $USER_UID -g appgroup appuser || true
fi

# 更改挂载路径的所有者
chown -R ${USER_UID}:${USER_GID} /jmalcloud
useradd --shell /bin/bash -u "${USER_UID}" -o -c "" -m user
usermod -a -G root user
export HOME=/home/user

# 启动主应用程序
exec gosu ${USER_UID}:${USER_GID} java -Dfile.encoding=UTF-8 -Dloader.path=/usr/local/clouddisk-lib -jar ${JVM_OPTS} /usr/local/clouddisk-${VERSION}.jar --spring.profiles.active=${RUN_ENVIRONMENT} --spring.data.mongodb.uri=${MONGODB_URI} --tess4j.data-path=${TESS4J_DATA_PATH} --file.monitor=${FILE_MONITOR} --file.rootDir=${FILE_ROOT_DIR} --logging.level.root=${LOG_LEVEL} --file.ip2region-db-path=/jmalcloud/ip2region.xdb
exec gosu "${USER_UID}" java -Dfile.encoding=UTF-8 -Dloader.path=/usr/local/clouddisk-lib -jar ${JVM_OPTS} /usr/local/clouddisk-${VERSION}.jar --spring.profiles.active=${RUN_ENVIRONMENT} --spring.data.mongodb.uri=${MONGODB_URI} --tess4j.data-path=${TESS4J_DATA_PATH} --file.monitor=${FILE_MONITOR} --file.rootDir=${FILE_ROOT_DIR} --logging.level.root=${LOG_LEVEL} --file.ip2region-db-path=/jmalcloud/ip2region.xdb

0 comments on commit c97d69e

Please sign in to comment.