This commit is contained in:
qiaofeng1227 2023-05-19 16:17:53 +08:00
parent 9a1ec05b07
commit 1386e45978
3 changed files with 10 additions and 10 deletions

View file

@ -10,7 +10,7 @@ COPY static ./static
COPY requirements.txt main.py ./
RUN apt update
# Install supervisord
# Install supervisords
RUN apt install -y supervisor
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY config/cmd.sh /cmd.sh

View file

@ -362,26 +362,27 @@ def get_apps_from_compose():
except IndexError:
pass
try:
app_version = list(docker.read_env(path, "APP_VERSION").values())[0]
app_version = env_map.get("APP_VERSION")
volume_data = ["/var/lib/docker/volumes"]
user_name = list(docker.read_env(path, "APP_USER").values())[0]
password = list(docker.read_env(path, "POWER_PASSWORD").values())[0]
user_name = env_map.get("APP_USER")
password = env_map.get("POWER_PASSWORD")
except IndexError:
pass
try:
replace = list(docker.read_env(path, "APP_URL_REPLACE").values())[0]
replace = env_map.get("APP_URL_REPLACE")
myLogger.info_logger("replace="+replace)
if replace == "true":
app_replace_url = True
https = list(docker.read_env(path, "APP_HTTPS_ACCESS").values())[0]
https = env_map.get("APP_HTTPS_ACCESS")
if https == "true":
app_https = True
except IndexError:
pass
try:
http_port = list(docker.read_env(path, "APP_HTTP_PORT").values())[0]
http_port = env_map.get("APP_HTTP_PORT")
if http_port:
port = int(http_port)
except IndexError:
pass

View file

@ -185,11 +185,10 @@ def get_map(path):
if int(code) == 0:
ret = output["result"]
env_list = ret.split("\n")
myLogger.info_logger(env_list)
for env in env_list:
myLogger.info_logger(env)
if "=" in env:
env_dic[env.split("=")[0]] = env.split("=")[1]
myLogger.info_logger(env_dic)
return env_dic
def read_env(path, key):