mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-02-03 01:28:39 +08:00
add update.sh
This commit is contained in:
parent
7ec0a94944
commit
78819990a1
@ -6,4 +6,3 @@ requests
|
|||||||
GitPython
|
GitPython
|
||||||
PyJWT
|
PyJWT
|
||||||
click
|
click
|
||||||
schedule
|
|
@ -1,12 +0,0 @@
|
|||||||
import schedule
|
|
||||||
import time
|
|
||||||
import os
|
|
||||||
|
|
||||||
def job():
|
|
||||||
os.system("echo 'start to test schedule'")
|
|
||||||
|
|
||||||
schedule.every(5).seconds.do(job)
|
|
||||||
|
|
||||||
while True:
|
|
||||||
schedule.run_pending()
|
|
||||||
time.sleep(1)
|
|
@ -1,4 +1,4 @@
|
|||||||
# modify time: 202310270905, you can modify here to trigger Docker Build action
|
# modify time: 202310271039, you can modify here to trigger Docker Build action
|
||||||
|
|
||||||
FROM python:3.10-bullseye AS buildstage
|
FROM python:3.10-bullseye AS buildstage
|
||||||
LABEL maintainer="Websoft9<help@websoft9.com>"
|
LABEL maintainer="Websoft9<help@websoft9.com>"
|
||||||
@ -36,8 +36,9 @@ COPY --from=buildstage /w9library ./library
|
|||||||
COPY --from=buildstage /websoft9/apphub ./apphub
|
COPY --from=buildstage /websoft9/apphub ./apphub
|
||||||
COPY --from=buildstage /swagger-ui/dist ./apphub/swagger-ui
|
COPY --from=buildstage /swagger-ui/dist ./apphub/swagger-ui
|
||||||
COPY --from=buildstage /websoft9/apphub/src/config ./config
|
COPY --from=buildstage /websoft9/apphub/src/config ./config
|
||||||
|
COPY --from=buildstage /websoft9/docker/apphub/script ./script
|
||||||
|
|
||||||
RUN apt update && apt install curl git jq iproute2 supervisor -y
|
RUN apt update && apt install curl git jq cron iproute2 supervisor -y --no-install-recommends
|
||||||
|
|
||||||
RUN pip install --no-cache-dir --upgrade -r apphub/requirements.txt
|
RUN pip install --no-cache-dir --upgrade -r apphub/requirements.txt
|
||||||
RUN pip install -e ./apphub
|
RUN pip install -e ./apphub
|
||||||
@ -45,9 +46,13 @@ RUN pip install -e ./apphub
|
|||||||
# supervisor
|
# supervisor
|
||||||
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
RUN chmod +r /etc/supervisor/conf.d/supervisord.conf
|
RUN chmod +r /etc/supervisor/conf.d/supervisord.conf
|
||||||
COPY config/entrypoint.sh /entrypoint.sh
|
|
||||||
RUN chmod +x /entrypoint.sh
|
# cron
|
||||||
COPY config/migration.sh /migration.sh
|
COPY config/cron /etc/cron.d/cron
|
||||||
|
RUN crontab /etc/cron.d/cron
|
||||||
|
|
||||||
|
# chmod for all .sh script
|
||||||
|
RUN find /websoft9/script -name "*.sh" -exec chmod +x {} \;
|
||||||
|
|
||||||
VOLUME /websoft9/apphub/logs
|
VOLUME /websoft9/apphub/logs
|
||||||
VOLUME /websoft9/apphub/src/config
|
VOLUME /websoft9/apphub/src/config
|
||||||
@ -58,4 +63,4 @@ RUN rm -rf apphub/docs apphub/tests library.zip plugin-appstore && \
|
|||||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man /usr/share/doc /usr/share/doc-base
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man /usr/share/doc /usr/share/doc-base
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/websoft9/script/entrypoint.sh"]
|
@ -1,6 +1,4 @@
|
|||||||
ARG APPHUB_VERSION
|
ARG APPHUB_VERSION
|
||||||
FROM websoft9dev/apphub:${APPHUB_VERSION} as buildstage
|
FROM websoft9dev/apphub:${APPHUB_VERSION} as buildstage
|
||||||
RUN mkdir -p /websoft9/apphub-dev
|
RUN mkdir -p /websoft9/apphub-dev
|
||||||
COPY apphub/config/developer.sh /developer.sh
|
RUN sed -i '/supervisorctl start apphub/c\supervisorctl start apphubdev' /websoft9/script/entrypoint.sh
|
||||||
RUN chmod +x /developer.sh
|
|
||||||
RUN sed -i '/supervisorctl start apphub/c\supervisorctl start apphubdev' /entrypoint.sh
|
|
1
docker/apphub/config/cron
Normal file
1
docker/apphub/config/cron
Normal file
@ -0,0 +1 @@
|
|||||||
|
* * * * * /websoft9/script/update.sh
|
@ -17,7 +17,7 @@ stderr_logfile=/var/log/supervisord.log
|
|||||||
stderr_logfile_maxbytes=0
|
stderr_logfile_maxbytes=0
|
||||||
|
|
||||||
[program:apphubdev]
|
[program:apphubdev]
|
||||||
command=/developer.sh
|
command=/websoft9/script/developer.sh
|
||||||
autostart=false
|
autostart=false
|
||||||
user=root
|
user=root
|
||||||
stdout_logfile=/var/log/supervisord.log
|
stdout_logfile=/var/log/supervisord.log
|
||||||
@ -25,11 +25,10 @@ stdout_logfile_maxbytes=0
|
|||||||
stderr_logfile=/var/log/supervisord.log
|
stderr_logfile=/var/log/supervisord.log
|
||||||
stderr_logfile_maxbytes=0
|
stderr_logfile_maxbytes=0
|
||||||
|
|
||||||
[program:updatemedia]
|
[program:cron]
|
||||||
command=/usr/local/bin/python update_media.py
|
command=cron -f
|
||||||
autostart=true
|
autostart=true
|
||||||
user=root
|
user=root
|
||||||
directory=/websoft9/apphub/src
|
|
||||||
stdout_logfile=/var/log/supervisord.log
|
stdout_logfile=/var/log/supervisord.log
|
||||||
stdout_logfile_maxbytes=0
|
stdout_logfile_maxbytes=0
|
||||||
stderr_logfile=/var/log/supervisord.log
|
stderr_logfile=/var/log/supervisord.log
|
||||||
|
@ -6,7 +6,7 @@ export PATH
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
bash /migration.sh
|
bash /websoft9/script/migration.sh
|
||||||
|
|
||||||
try_times=5
|
try_times=5
|
||||||
supervisord
|
supervisord
|
7
docker/apphub/script/update.sh
Normal file
7
docker/apphub/script/update.sh
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# update media and library
|
||||||
|
|
||||||
|
echo "Compare remote version and local version"
|
||||||
|
|
||||||
|
echo "Download "
|
@ -1,3 +1,5 @@
|
|||||||
# S6
|
# S6
|
||||||
|
|
||||||
S6 is a mulitply process management tools at Nginx Proxy Manager.
|
S6 is a mulitply process management tools at Nginx Proxy Manager.
|
||||||
|
|
||||||
|
- nginx_proxy() at migration.sh: Migration initproxy.conf to Nginx, condition is compare Container created time and Named Volumes created time
|
||||||
|
Loading…
Reference in New Issue
Block a user