From 0f65442684e0300bfd68613dcc35283ee1ae7efd Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Tue, 19 Sep 2023 18:53:05 +0800 Subject: [PATCH] apphub --- docker/w9apphub/Dockerfile | 2 +- docker/w9apphub/config/entrypoint.sh | 23 ++++++++++++++++++++++- docker/w9apphub/config/supervisord.conf | 5 +---- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/docker/w9apphub/Dockerfile b/docker/w9apphub/Dockerfile index 2df00ff5..540fd711 100644 --- a/docker/w9apphub/Dockerfile +++ b/docker/w9apphub/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.10-bullseye AS buildstage LABEL maintainer="Websoft9" -LABEL version="0.8.17" +LABEL version="0.0.1" ENV LIBRARY_VERSION=v0.5.4 diff --git a/docker/w9apphub/config/entrypoint.sh b/docker/w9apphub/config/entrypoint.sh index e936b112..def035c6 100644 --- a/docker/w9apphub/config/entrypoint.sh +++ b/docker/w9apphub/config/entrypoint.sh @@ -1,10 +1,31 @@ #!/bin/bash # check +check_file_exists() { + file_path=$1 + max_attempts=$2 + for ((i=1; i<=max_attempts; i++)) + do + if [ -f "$file_path" ]; then + echo "$file_path exists" + break + else + echo "$file_path is not exists, wait a moment.." + fi + sleep 2 + if ((i==max_attempts)); then + echo "$file_path is not exists, timeout." + break + fi + done +} + +check_file_exists "/websoft9/credentials/proxy" 10 +check_file_exists "/websoft9/credentials/git" 10 +check_file_exists "/websoft9/credentials/deployment" 10 # start by supervisord - /usr/local/bin/supervisord supervisorctl start all tail -f /dev/null \ No newline at end of file diff --git a/docker/w9apphub/config/supervisord.conf b/docker/w9apphub/config/supervisord.conf index 1cb73291..405cbe1a 100644 --- a/docker/w9apphub/config/supervisord.conf +++ b/docker/w9apphub/config/supervisord.conf @@ -1,12 +1,9 @@ [supervisord] - nodaemon=false [supervisorctl] - [program:apphub] - -command=uvicorn app.main:app --reload --host 0.0.0.0 --port 8080 --log-level info +command=uvicorn main:app --reload --port 8080 autostart=true directory=/websoft9/apphub/src \ No newline at end of file