mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-24 10:17:15 +08:00
app_url
This commit is contained in:
parent
fd04682cf4
commit
df571719ff
@ -10,7 +10,7 @@ COPY static ./static
|
|||||||
COPY requirements.txt main.py ./
|
COPY requirements.txt main.py ./
|
||||||
RUN apt update
|
RUN apt update
|
||||||
|
|
||||||
# Install supervisord
|
# Install supervisords
|
||||||
RUN apt install -y supervisor
|
RUN apt install -y supervisor
|
||||||
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
COPY config/cmd.sh /cmd.sh
|
COPY config/cmd.sh /cmd.sh
|
||||||
|
@ -157,15 +157,19 @@ def check_app_url(customer_app_name):
|
|||||||
# 如果app的.env文件中含有HTTP_URL项目,需要如此设置 HTTP_URL=ip:port
|
# 如果app的.env文件中含有HTTP_URL项目,需要如此设置 HTTP_URL=ip:port
|
||||||
env_path = "/data/apps/" + customer_app_name + "/.env"
|
env_path = "/data/apps/" + customer_app_name + "/.env"
|
||||||
if read_env(env_path, "HTTP_URL") != {}:
|
if read_env(env_path, "HTTP_URL") != {}:
|
||||||
|
app_url = list(read_env(env_path, "HTTP_URL").values())[0]
|
||||||
ip = "localhost"
|
ip = "localhost"
|
||||||
try:
|
try:
|
||||||
ip_result = shell_execute.execute_command_output_all("cat /data/apps/stackhub/docker/w9appmanage/public_ip")
|
ip_result = shell_execute.execute_command_output_all("cat /data/apps/stackhub/docker/w9appmanage/public_ip")
|
||||||
ip = ip_result["result"].rstrip('\n')
|
ip = ip_result["result"].rstrip('\n')
|
||||||
except Exception:
|
except Exception:
|
||||||
ip = "127.0.0.1"
|
ip = "127.0.0.1"
|
||||||
http_port = list(read_env(path, "APP_HTTP_PORT").values())[0]
|
http_port = list(read_env(env_path, "APP_HTTP_PORT").values())[0]
|
||||||
url = ip + ":" + http_port
|
if ":" in app_url:
|
||||||
modify_env(path, "HTTP_URL", url)
|
url = ip + ":" + http_port
|
||||||
|
else:
|
||||||
|
url = ip
|
||||||
|
modify_env(env_path, "HTTP_URL", url)
|
||||||
|
|
||||||
myLogger.info_logger("App url check complete")
|
myLogger.info_logger("App url check complete")
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user