mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-24 01:50:19 +08:00
domain
This commit is contained in:
parent
b7264af4cc
commit
4ade655f34
@ -10,7 +10,7 @@ COPY static ./static
|
||||
COPY requirements.txt main.py ./
|
||||
RUN apt update
|
||||
|
||||
# Install supervisordss
|
||||
# Install supervisord
|
||||
RUN apt install -y supervisor
|
||||
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY config/cmd.sh /cmd.sh
|
||||
@ -18,5 +18,5 @@ RUN chmod +x /etc/supervisor/conf.d/supervisord.conf /cmd.sh
|
||||
RUN pip install -r requirements.txt
|
||||
RUN mkdir /data
|
||||
|
||||
# Expose the port in which the application will be deployed
|
||||
# Expose the port in which the application will be deployeds
|
||||
EXPOSE 5000
|
@ -326,7 +326,7 @@ def get_apps_from_compose():
|
||||
default_domain = ""
|
||||
if customer_name in ['w9appmanage', 'w9nginxproxymanager','w9redis','w9portainer'] and app_path == '/data/apps/stackhub/docker/' + customer_name:
|
||||
continue
|
||||
# get code
|
||||
|
||||
status = app_info["Status"].split("(")[0]
|
||||
if status == "running" or status == "exited" or status == "restarting":
|
||||
myLogger.info_logger("ok")
|
||||
@ -352,8 +352,9 @@ def get_apps_from_compose():
|
||||
image_url = get_Image_url(app_name)
|
||||
# get env info
|
||||
path = app_path + "/.env"
|
||||
env_map = docker.get_map(path)
|
||||
try:
|
||||
domain = list(docker.read_env(path, "APP_URL").values())[0]
|
||||
domain = env_map.get("APP_URL")
|
||||
if "appname.example.com" in domain or ip in domain:
|
||||
default_domain = ""
|
||||
else:
|
||||
|
@ -177,6 +177,17 @@ def check_app_url(customer_app_name):
|
||||
myLogger.info_logger("App url check complete")
|
||||
return
|
||||
|
||||
def get_map(path):
|
||||
myLogger.info_logger("Read env_dic" + path)
|
||||
output = shell_execute.execute_command_output_all("cat " + path)
|
||||
code = output["code"]
|
||||
env_dic = {}
|
||||
if int(code) == 0:
|
||||
ret = output["result"]
|
||||
env_list = ret.split("\n")
|
||||
for env in env_list:
|
||||
env_dic[env.split("=")[0]] = env.split("=")[1]
|
||||
return env_dic
|
||||
|
||||
def read_env(path, key):
|
||||
myLogger.info_logger("Read " + path)
|
||||
|
Loading…
Reference in New Issue
Block a user