diff --git a/docker/apphub/Dockerfile b/docker/apphub/Dockerfile index 41785e57..aaa9e807 100644 --- a/docker/apphub/Dockerfile +++ b/docker/apphub/Dockerfile @@ -39,6 +39,7 @@ RUN chmod +r /etc/supervisor/conf.d/supervisord.conf COPY config/entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh + VOLUME /websoft9/apphub/logs VOLUME /websoft9/apphub/src/config VOLUME /websoft9/media diff --git a/docker/apphub/Dockerfiletmp b/docker/apphub/Dockerfiletmp new file mode 100644 index 00000000..249424a0 --- /dev/null +++ b/docker/apphub/Dockerfiletmp @@ -0,0 +1,51 @@ +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/entrypoint.sh b/docker/apphub/config/entrypoint.sh index e735ab1c..bfc3ebb5 100644 --- a/docker/apphub/config/entrypoint.sh +++ b/docker/apphub/config/entrypoint.sh @@ -37,6 +37,5 @@ fi # start by supervisord /usr/bin/supervisord # debug -cat /entrypoint.sh |grep "supervisorctl start" supervisorctl start apphub tail -f /dev/null \ No newline at end of file diff --git a/docker/docker-compose-dev.yml b/docker/docker-compose-dev.yml index 702c4020..c89ac485 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/Dockerfiledev + dockerfile: ./apphub/Dockerfiletmp args: - APPHUB_VERSION=${APPHUB_VERSION} ports: diff --git a/version.json b/version.json index 4beb62ae..ffe12a18 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "0.8.26-rc55", + "version": "0.8.26-rc56", "plugins": { "portainer": "0.0.7", "nginx": "0.0.5",