apphub image

This commit is contained in:
qiaofeng1227 2023-09-18 10:52:08 +08:00
parent 9a4fb6941f
commit 73cda97648
4 changed files with 14 additions and 18 deletions

View File

@ -1,9 +1,7 @@
fastapi==0.98.0 fastapi
uvicorn uvicorn
rq
apscheduler
docker
psutil
gunicorn
python-dotenv
keyring keyring
requests
git
GitPython
PyJWT

View File

@ -1,16 +1,14 @@
FROM python:3.10-slim FROM python:3.10-slim
LABEL maintainer="Websoft9<help@websoft9.com>" LABEL maintainer="Websoft9<help@websoft9.com>"
LABEL version="0.8.19" LABEL version="0.0.1"
# Create API Directory # Create API Directory
WORKDIR /usr/src/app WORKDIR /usr
# Copy source and install pip dpendencies # Copy source and install pip dpendencies
COPY api ./api COPY ../../appmanage_new/src /usr
COPY static ./static COPY ../../appmanage_new/requirements.txt /usr
COPY requirements.txt main.py hostname.py ./
RUN mkdir /usr/src/app/db
COPY database.sqlite /usr/src/app/db/
RUN apt update RUN apt update
# Install supervisord # Install supervisord

View File

@ -2,8 +2,8 @@
# start by supervisord # start by supervisord
internal_ip=$(ip addr show eth0 | awk '/inet /{split($2, a, "/"); print a[1]}') 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 "sed -i '/websoft9-apphub/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 "echo $internal_ip websoft9-apphub>> /etc/hosts"
/usr/bin/supervisord /usr/bin/supervisord
supervisorctl start all supervisorctl start all
tail -f /dev/null tail -f /dev/null

View File

@ -1,6 +1,6 @@
[supervisord] [supervisord]
nodaemon=false nodaemon=false
uvicorn app.main:app --reload --port 8080
[program:appmanage] [program:appmanage]
command=uvicorn main:get_app --host 0.0.0.0 --port 5000 --log-level info command=uvicorn main:get_app --host 0.0.0.0 --port 5000 --log-level info
autostart=true autostart=true