From 0b7561576cbd21682a4e8cdd982bee0251984edf Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Tue, 10 Oct 2023 18:29:23 +0800 Subject: [PATCH] apphub --- docker/apphub-dev.yml | 24 -------- docker/apphub/Dockerfile | 2 + docker/apphub/Dockerfiledev | 3 + docker/apphub/config/supervisord.conf | 2 +- docker/docker-compose-dev.yml | 84 +++++++++++++++++++++++++++ 5 files changed, 90 insertions(+), 25 deletions(-) delete mode 100644 docker/apphub-dev.yml create mode 100644 docker/apphub/Dockerfiledev create mode 100644 docker/docker-compose-dev.yml diff --git a/docker/apphub-dev.yml b/docker/apphub-dev.yml deleted file mode 100644 index 3aaa76a1..00000000 --- a/docker/apphub-dev.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: "3.8" - -services: - apphub: - image: websoft9dev/apphub:$APPHUB_VERSION - container_name: websoft9-apphub - build: - context: . - dockerfile_inline: | - websoft9dev/apphub:$APPHUB_VERSION - RUN cp -r /websoft9/apphub /websoft9/src - RUN sed -i 's/supervisorctl start apphub/supervisorctl start apphubdev/g' /entrypoint.sh - VOLUME /websoft9/src - ports: - - 9001-9999:8080 - restart: always - volumes: - - /data/mysource:/websoft9/src - - apphub_media:/websoft9/media - - apphub_logs:/websoft9/apphub/logs - depends_on: - - deployment - - git - - proxy \ No newline at end of file diff --git a/docker/apphub/Dockerfile b/docker/apphub/Dockerfile index c74c14e6..8af32606 100644 --- a/docker/apphub/Dockerfile +++ b/docker/apphub/Dockerfile @@ -31,6 +31,7 @@ RUN apt update && apt install git jq iproute2 supervisor -y && \ echo "This folder stored the credentials of other services that integrated with apphub" > credentials/readme RUN pip install --upgrade pip && pip install -r apphub/requirements.txt +RUN cd apphub && pip install . # supervisor COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf RUN chmod +r /etc/supervisor/conf.d/supervisord.conf @@ -46,5 +47,6 @@ 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/Dockerfiledev b/docker/apphub/Dockerfiledev new file mode 100644 index 00000000..5ea55635 --- /dev/null +++ b/docker/apphub/Dockerfiledev @@ -0,0 +1,3 @@ +FROM websoft9dev/apphub:0.0.4 as buildstage +RUN mkdir -p /websoft9/src +RUN sed -i 's/supervisorctl start apphub/supervisorctl start apphubdev/g' /entrypoint.sh \ No newline at end of file diff --git a/docker/apphub/config/supervisord.conf b/docker/apphub/config/supervisord.conf index 29c718fa..2ecdfdab 100644 --- a/docker/apphub/config/supervisord.conf +++ b/docker/apphub/config/supervisord.conf @@ -7,6 +7,6 @@ autostart=true directory=/websoft9/apphub [program:apphubdev] -command=uvicorn src.main:app --reload --host 0.0.0.0 --port 8080 --log-level error +command=/bin/bash -c 'cp -r /websoft9/apphub/* /websoft9/src && uvicorn src.main:app --reload --host 0.0.0.0 --port 8080 --log-level error' autostart=true directory=/websoft9/src \ No newline at end of file diff --git a/docker/docker-compose-dev.yml b/docker/docker-compose-dev.yml new file mode 100644 index 00000000..33df2c05 --- /dev/null +++ b/docker/docker-compose-dev.yml @@ -0,0 +1,84 @@ +version: "3.8" + +services: + apphub: + image: websoft9dev/apphub:dev + container_name: websoft9-apphub + build: + context: . + dockerfile: ./apphub/Dockerfiledev + ports: + - 9001-9999:8080 + restart: always + volumes: + - /data/mysource:/websoft9/src + - apphub_media:/websoft9/media + - apphub_logs:/websoft9/apphub/logs + depends_on: + - deployment + - git + - proxy + + deployment: + image: websoft9dev/deployment:$DEPLOYMENT_VERSION + container_name: websoft9-deployment + restart: always + ports: + - 9001-9999:9000 + volumes: + - portainer:/data + - /data/compose:/data/compose + - /var/run/docker.sock:/var/run/docker.sock + #- /run/podman/podman.sock:/var/run/docker.sock + labels: + com.docker.compose.w9_http.port: 9000 + + git: + image: websoft9dev/git:$GIT_VERSION + container_name: websoft9-git + restart: always + volumes: + - gitea:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - 9001-9999:3000 + environment: + - INSTALL_LOCK=true + - DISABLE_SSH=true + - RUN_MODE=prod + - HTTP_PORT=3000 + - DISABLE_REGISTRATION=false + - REQUIRE_SIGNIN_VIEW=false + labels: + com.docker.compose.w9_http.port: 3000 + + proxy: + image: websoft9dev/proxy:$PROXY_VERSION + container_name: websoft9-proxy + restart: always + ports: + - "80:80" + - "443:443" + - "9001-9999:81" + volumes: + - nginx_data:/data + - nginx_letsencrypt:/etc/letsencrypt + labels: + com.docker.compose.w9_http.port: 80 + com.docker.compose.w9_https.port: 443 + com.docker.compose.w9_console.port: 81 + +networks: + default: + name: websoft9 + external: true + +volumes: + apphub_logs: + apphub_media: + apphub_config: + portainer: + gitea: + nginx_data: + nginx_letsencrypt: \ No newline at end of file