diff --git a/docker/apphub/Dockerfile b/docker/apphub/Dockerfile index aaa9e807..1fb85d64 100644 --- a/docker/apphub/Dockerfile +++ b/docker/apphub/Dockerfile @@ -50,4 +50,6 @@ 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 EXPOSE 8080 -ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["/entrypoint.sh"] + +# modify time: 202310181524 \ No newline at end of file diff --git a/docker/apphub/Dockerfiledev b/docker/apphub/Dockerfiledev index 598a4cb1..027bed22 100644 --- a/docker/apphub/Dockerfiledev +++ b/docker/apphub/Dockerfiledev @@ -1,4 +1,6 @@ ARG APPHUB_VERSION FROM websoft9dev/apphub:${APPHUB_VERSION} as buildstage -RUN mv /websoft9/apphub /websoft9/apphub-dev +RUN mkdir -p /websoft9/apphub-dev +COPY apphub/config/developer.sh /developer.sh +RUN chmod +x /developer.sh RUN sed -i 's/supervisorctl start apphub/supervisorctl start apphubdev/g' /entrypoint.sh \ No newline at end of file diff --git a/docker/apphub/Dockerfiletmp b/docker/apphub/Dockerfiletmp deleted file mode 100644 index 249424a0..00000000 --- a/docker/apphub/Dockerfiletmp +++ /dev/null @@ -1,51 +0,0 @@ -FROM python:3.10-bullseye AS buildstage -LABEL maintainer="Websoft9" -LABEL version="0.0.6" - -ENV LIBRARY_VERSION=v0.5.8 - -# Prepare library -RUN wget https://github.com/Websoft9/docker-library/archive/refs/tags/$LIBRARY_VERSION.zip -O ./library.zip && \ - unzip library.zip && \ - mv docker-library-* library && \ - mkdir credentials && \ - echo "This folder stored the credentials of other services that apphub will connect" > credentials/readme && \ - # Prepare Media and master data from Contentful - git clone --depth=1 https://github.com/swagger-api/swagger-ui.git && \ - wget https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js && \ - cp redoc.standalone.js swagger-ui/dist && \ - git clone --depth=1 https://github.com/Websoft9/plugin-appstore && \ - mv -f plugin-appstore/data ./media && \ - git clone --depth=1 https://github.com/Websoft9/websoft9 - -FROM python:3.10-slim-bullseye -WORKDIR /websoft9 - -COPY --from=buildstage /media/data ./media -COPY --from=buildstage /library ./library -COPY --from=buildstage /websoft9/apphub ./apphub-dev -COPY --from=buildstage /swagger-ui/dist ./apphub-dev/swagger-ui - -RUN apt update && apt install git jq iproute2 supervisor -y && \ - mkdir credentials && \ - echo "This folder stored the credentials of other services that integrated with apphub" > credentials/readme - -RUN pip install --upgrade pip && pip install -r apphub-dev/requirements.txt -RUN pip install -e ./apphub-dev - -# supervisor -COPY apphub/config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf -RUN chmod +r /etc/supervisor/conf.d/supervisord.conf -COPY apphub/config/entrypoint.sh /entrypoint.sh -RUN sed -i 's/supervisorctl start apphub/supervisorctl start apphubdev/g' /entrypoint.sh -RUN chmod +x /entrypoint.sh - -VOLUME /websoft9/media - -# Clean cache and install files -RUN rm -rf apphub/docs apphub/tests library.zip plugin-appstore && \ - apt clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man /usr/share/doc /usr/share/doc-base - -EXPOSE 8080 -ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/docker/apphub/config/developer.sh b/docker/apphub/config/developer.sh new file mode 100644 index 00000000..73f53b02 --- /dev/null +++ b/docker/apphub/config/developer.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +echo "Start to cp source code" +if [ ! "$(ls -A /websoft9/apphub-dev)" ]; then + cp -r /websoft9/apphub/* /websoft9/apphub-dev +fi + +echo "Running the apphub" +cd /websoft9/apphub-dev +uvicorn src.main:app --reload --host 0.0.0.0 --port 8080 --log-level error' \ No newline at end of file diff --git a/docker/apphub/config/supervisord.conf b/docker/apphub/config/supervisord.conf index b7865531..c534b6ec 100644 --- a/docker/apphub/config/supervisord.conf +++ b/docker/apphub/config/supervisord.conf @@ -7,6 +7,8 @@ autostart=false directory=/websoft9/apphub [program:apphubdev] -command=uvicorn src.main:app --reload --host 0.0.0.0 --port 8080 --log-level error +command=/developer.sh autostart=false -directory=/websoft9/apphub-dev \ No newline at end of file +redirect_stderr=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 \ No newline at end of file diff --git a/docker/docker-compose-dev.yml b/docker/docker-compose-dev.yml index c89ac485..702c4020 100644 --- a/docker/docker-compose-dev.yml +++ b/docker/docker-compose-dev.yml @@ -9,7 +9,7 @@ services: container_name: websoft9-apphub build: context: . - dockerfile: ./apphub/Dockerfiletmp + dockerfile: ./apphub/Dockerfiledev args: - APPHUB_VERSION=${APPHUB_VERSION} ports: diff --git a/install/install.sh b/install/install.sh index e02e7195..6a4f16ff 100644 --- a/install/install.sh +++ b/install/install.sh @@ -277,6 +277,7 @@ set_docker(){ sudo firewall-cmd --permanent --zone=docker --set-target=ACCEPT sudo firewall-cmd --reload sudo systemctl stop firewalld + sudo systemctl disable firewalld fi sudo systemctl restart docker } @@ -393,6 +394,9 @@ if [ $? -ne 0 ]; then exit 1 fi +echo "Restart Docker for Firewalld..." +sudo systemctl restart docker + install_systemd diff --git a/version.json b/version.json index 1faf7733..4c490648 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "0.8.26-rc61", + "version": "0.8.26-rc62", "plugins": { "portainer": "0.0.7", "nginx": "0.0.5",