From 73cda97648e5c6412a8d46b2145ce9ffb1318154 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Mon, 18 Sep 2023 10:52:08 +0800 Subject: [PATCH] apphub image --- appmanage_new/requirements.txt | 14 ++++++-------- docker/w9apphub/Dockerfile | 12 +++++------- docker/w9apphub/config/cmd.sh | 4 ++-- docker/w9apphub/config/supervisord.conf | 2 +- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/appmanage_new/requirements.txt b/appmanage_new/requirements.txt index 4a4033fb..efe0223e 100644 --- a/appmanage_new/requirements.txt +++ b/appmanage_new/requirements.txt @@ -1,9 +1,7 @@ -fastapi==0.98.0 +fastapi uvicorn -rq -apscheduler -docker -psutil -gunicorn -python-dotenv -keyring \ No newline at end of file +keyring +requests +git +GitPython +PyJWT \ No newline at end of file diff --git a/docker/w9apphub/Dockerfile b/docker/w9apphub/Dockerfile index f4b73d24..fab17f47 100644 --- a/docker/w9apphub/Dockerfile +++ b/docker/w9apphub/Dockerfile @@ -1,16 +1,14 @@ FROM python:3.10-slim LABEL maintainer="Websoft9" -LABEL version="0.8.19" +LABEL version="0.0.1" # Create API Directory -WORKDIR /usr/src/app +WORKDIR /usr # Copy source and install pip dpendencies -COPY api ./api -COPY static ./static -COPY requirements.txt main.py hostname.py ./ -RUN mkdir /usr/src/app/db -COPY database.sqlite /usr/src/app/db/ +COPY ../../appmanage_new/src /usr +COPY ../../appmanage_new/requirements.txt /usr + RUN apt update # Install supervisord diff --git a/docker/w9apphub/config/cmd.sh b/docker/w9apphub/config/cmd.sh index aed3474c..4da1fbeb 100644 --- a/docker/w9apphub/config/cmd.sh +++ b/docker/w9apphub/config/cmd.sh @@ -2,8 +2,8 @@ # start by supervisord internal_ip=$(ip addr show eth0 | awk '/inet /{split($2, a, "/"); print a[1]}') -nsenter -m -u -i -n -p -t 1 sh -c "sed -i '/websoft9-appmanage/d' /etc/hosts" -nsenter -m -u -i -n -p -t 1 sh -c "echo $internal_ip websoft9-appmanage>> /etc/hosts" +nsenter -m -u -i -n -p -t 1 sh -c "sed -i '/websoft9-apphub/d' /etc/hosts" +nsenter -m -u -i -n -p -t 1 sh -c "echo $internal_ip websoft9-apphub>> /etc/hosts" /usr/bin/supervisord supervisorctl start all tail -f /dev/null diff --git a/docker/w9apphub/config/supervisord.conf b/docker/w9apphub/config/supervisord.conf index 7b67ac3e..509f3594 100644 --- a/docker/w9apphub/config/supervisord.conf +++ b/docker/w9apphub/config/supervisord.conf @@ -1,6 +1,6 @@ [supervisord] nodaemon=false - +uvicorn app.main:app --reload --port 8080 [program:appmanage] command=uvicorn main:get_app --host 0.0.0.0 --port 5000 --log-level info autostart=true