Files
weipan02_server/docker/entrypoint.sh
2025-10-31 16:17:15 +08:00

29 lines
784 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
set -e
cp /usr/share/zoneinfo/${SERVER_DATE_TIMEZONE:-Asia/Shanghai} /etc/localtime
echo "${SERVER_DATE_TIMEZONE:-Asia/Shanghai}" > /etc/timezone
# 动态设置 PHP_DATE_TIMEZONE 与 SERVER_DATE_TIMEZONE 保持一致(运行时生效)
export PHP_DATE_TIMEZONE=${SERVER_DATE_TIMEZONE:-Asia/Shanghai}
date
# 根据环境变量生成 .env 文件
cat > /app/.env <<EOF
[DATABASE]
HOSTNAME=${database_hostname:-10.100.100.88}
DATABASE=${database_database:-mydatabase}
USERNAME=${database_username:-myuser}
PASSWORD=${database_password:-mypassword}
CHARSET=${database_charset:-utf8mb4}
HOSTPORT=${database_hostport:-3306}
EOF
echo "Generated .env file:"
cat /app/.env
# 执行原始镜像的入口点webdevops 镜像使用 supervisord
exec /entrypoint supervisord