diff --git a/docker_casdoor/casdoor.Dockerfile b/docker_casdoor/casdoor.Dockerfile index 463b1e5e..ee55cf8b 100644 --- a/docker_casdoor/casdoor.Dockerfile +++ b/docker_casdoor/casdoor.Dockerfile @@ -30,7 +30,6 @@ LABEL maintainer="postmaster@labnow.ai" ENV RUNNING_IN_DOCKER=true # 8000=web, 389=ldap, 1812=radius EXPOSE 8000 389 1812 -ENTRYPOINT ["/bin/bash"] CMD ["/opt/casdoor/docker-entrypoint.sh"] WORKDIR /opt/casdoor # https://casdoor.org/zh/docs/provider/storage/localFileSystem/ diff --git a/docker_clash/clash.Dockerfile b/docker_clash/clash.Dockerfile index bee1b959..03f567cc 100644 --- a/docker_clash/clash.Dockerfile +++ b/docker_clash/clash.Dockerfile @@ -30,7 +30,7 @@ RUN set -eux \ && ln -sf /opt/clash/start-clash.sh /usr/local/bin/ WORKDIR /opt/clash -ENTRYPOINT ["/opt/clash/start-clash.sh"] +CMD ["/opt/clash/start-clash.sh"] # Healthcheck to verify if Clash REST API is healthy HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ diff --git a/docker_clash/work/clash/start-clash.sh b/docker_clash/work/clash/start-clash.sh index 570be077..f2b5ae3f 100755 --- a/docker_clash/work/clash/start-clash.sh +++ b/docker_clash/work/clash/start-clash.sh @@ -105,7 +105,7 @@ echo "Clash transparent proxy network rules setup complete." # 7. Start Clash in the background and wait for it # We do not use exec so that this script remains active to trap signals and perform cleanup. -/opt/clash/clash -d /opt/clash/config "$@" & +exec /opt/clash/clash -d /opt/clash/config "$@" & CLASH_PID=$! # Perform post-startup initialization in the background (wait for REST API and set default GLOBAL proxy) diff --git a/docker_gui/gui_linux.Dockerfile b/docker_gui/gui_linux.Dockerfile index ef7581c7..252731bd 100644 --- a/docker_gui/gui_linux.Dockerfile +++ b/docker_gui/gui_linux.Dockerfile @@ -31,7 +31,7 @@ RUN set -eux && chmod +x /opt/utils/*.sh \ ## Cache the published capture-stack wheels for the patched Selkies dependency range. && cd / \ && pip wheel --no-cache-dir --only-binary=:all: \ - 'pixelflux~=2.0.0' 'pcmflux~=2.0.0' -w /opt/selkies + 'pixelflux' 'pcmflux' -w /opt/selkies # Stage 2: runtime image diff --git a/docker_gui/work/script-setup-gui.sh b/docker_gui/work/script-setup-gui.sh index e75f8d96..2be51ad5 100644 --- a/docker_gui/work/script-setup-gui.sh +++ b/docker_gui/work/script-setup-gui.sh @@ -126,11 +126,6 @@ setup_selkies_from_source() { && rm -rf /opt/selkies "${src_dir}" \ && mkdir -pv /opt/selkies/share \ && checkout_selkies_source "${ref}" "${src_dir}" \ - && echo "Using the latest published pixelflux/pcmflux 2.0 wheels until 2.1 is available on PyPI" \ - && sed -i \ - -e 's/pixelflux~=2\.1\.0/pixelflux~=2.0.0/' \ - -e 's/pcmflux~=2\.1\.0/pcmflux~=2.0.0/' \ - "${src_dir}/pyproject.toml" \ && setup_selkies_web_from_source "${src_dir}" /opt/selkies/share/selkies-web \ && setup_selkies_python_from_source "${src_dir}" \ && setup_selkies_addons_from_source "${src_dir}" \ diff --git a/docker_ignis/ignis.Dockerfile b/docker_ignis/ignis.Dockerfile index 1bb0d16a..c6addd23 100644 --- a/docker_ignis/ignis.Dockerfile +++ b/docker_ignis/ignis.Dockerfile @@ -39,4 +39,5 @@ VOLUME ["/vaults", "/app/obsidian-app", "/app/data"] EXPOSE 8080 -ENTRYPOINT ["/app/apps/ignis-server/scripts/entrypoint.sh"] +ENTRYPOINT ["tini", "-g", "--"] +CMD ["/app/apps/ignis-server/scripts/entrypoint.sh"] diff --git a/docker_nocobase/nocobase.Dockerfile b/docker_nocobase/nocobase.Dockerfile index 8a4f07df..36c6888a 100644 --- a/docker_nocobase/nocobase.Dockerfile +++ b/docker_nocobase/nocobase.Dockerfile @@ -5,8 +5,12 @@ ARG BASE_IMG="atom" FROM ${BASE_NAMESPACE:+$BASE_NAMESPACE/}${BASE_IMG} +LABEL maintainer="postmaster@labnow.ai" + COPY work /opt/utils +ENV APPEND_PRESET_BUILT_IN_PLUGINS="@nocobase-plugin/casdoor,@nocobase-plugin/datasource-postgres" + RUN set -eux \ && apt-get -qq update -yq --fix-missing && apt-get -qq install -yq --no-install-recommends \ curl git jq htop \ @@ -21,18 +25,23 @@ RUN set -eux \ && mv /opt/utils/docker-entrypoint.sh /opt/nocobase/ \ && chmod +x /opt/nocobase/*.sh \ && ls -alh \ + ## install plugins (plugins shall be enabled only in runtime) \ + && IFS=',' read -r -a list_plugins <<< "${APPEND_PRESET_BUILT_IN_PLUGINS}" \ + && if [ "${#list_plugins[@]}" -gt 0 ]; then \ + yarn add -W "${list_plugins[@]}"; \ + fi \ ## Clean up and display components version information... - && find ./node_modules -type f \( -name "README.md" -o -name "License" \) -delete 2>/dev/null \ - && find ./node_modules -type d \( -name "test" -o -name "tests" -o -name "__tests__" -o -name "docs" -o -name "doc" \) -exec rm -rf {} + 2>/dev/null \ + && find node_modules -type d \( -name "docs" -o -name "doc" \) -exec rm -rf {} + \ + && find node_modules -type f \( -name "README.md" -o -name "License" \) -delete \ + && find node_modules -type f \( -name "*.map" -o -name "yarn.lock" \) -delete \ + && find node_modules -type f \( -name "bower.json" -o -name "composer.json" \) -delete \ + && find node_modules -type f -name "*.md" ! -path "node_modules/@nocobase/*" -delete \ + && nb --version \ && list_installed_packages && install__clean -LABEL maintainer="postmaster@labnow.ai" -EXPOSE 13000 - -# Healthcheck: nocobase listens on 13000, startup may take longer due to DB install/migration -HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ - CMD ["curl", "--head", "-fsS", "http://localhost:13000/"] +ENV APPEND_PRESET_BUILT_IN_PLUGINS="${APPEND_PRESET_BUILT_IN_PLUGINS},@nocobase/plugin-departments" +EXPOSE 13000 WORKDIR /opt/nocobase VOLUME [ "/opt/nocobase/storage" ] @@ -44,3 +53,7 @@ VOLUME [ "/opt/nocobase/storage" ] # After that, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. SHELL ["/bin/bash", "--login", "-o", "pipefail", "-c"] CMD [ "/opt/nocobase/docker-entrypoint.sh" ] + +# Healthcheck: nocobase listens on 13000, startup may take longer due to DB install/migration +HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ + CMD ["curl", "--head", "-fsS", "http://localhost:13000/"] diff --git a/docker_nocobase/work/docker-entrypoint.sh b/docker_nocobase/work/docker-entrypoint.sh index 0b0a3930..c79e0791 100755 --- a/docker_nocobase/work/docker-entrypoint.sh +++ b/docker_nocobase/work/docker-entrypoint.sh @@ -11,4 +11,4 @@ fi source /etc/profile.d/path-*.sh -cd /opt/nocobase && yarn nocobase install --lang=${LOCALE:-"zh-CN"} && yarn start --quickstart +cd /opt/nocobase && yarn nocobase install --lang=${LOCALE:-"zh-CN"} && exec yarn start --quickstart diff --git a/docker_nocobase/work/script-setup-nocobase.sh b/docker_nocobase/work/script-setup-nocobase.sh index 319217e1..d302a45a 100755 --- a/docker_nocobase/work/script-setup-nocobase.sh +++ b/docker_nocobase/work/script-setup-nocobase.sh @@ -4,13 +4,7 @@ setup_nocobase_create_app(){ && npx -y create-nocobase-app@${VER_NOCO} nocobase --empty-key --skip-dev-dependencies -a -e APP_ENV=production \ && cd nocobase \ && yarn install --production \ - && rm -rf yarn.lock \ - && find node_modules -type f -name "yarn.lock" -delete \ - && find node_modules -type f -name "bower.json" -delete \ - && find node_modules -type f -name "composer.json" -delete \ - && find node_modules -type d -name docs ! -path "node_modules/@nocobase/*" -prune -exec rm -rf '{}' + \ - && find node_modules -type f -name "*.map" -delete \ - && find node_modules -type f -name "*.md" ! -path "node_modules/@nocobase/*" -delete ; + && rm -rf yarn.lock ; } setup_nocobase_from_source(){ diff --git a/docker_openresty/openresty.Dockerfile b/docker_openresty/openresty.Dockerfile index f2ca2a13..11afedff 100644 --- a/docker_openresty/openresty.Dockerfile +++ b/docker_openresty/openresty.Dockerfile @@ -31,8 +31,7 @@ RUN set -eux \ VOLUME ["/var/log/nginx", "/var/cache/nginx", "/etc/nginx/ssl", "/root/.acme.sh"] -ENTRYPOINT ["/docker-entrypoint.sh"] -CMD ["nginx"] +CMD ["/docker-entrypoint.sh", "nginx"] EXPOSE 80 # Use SIGQUIT instead of default SIGTERM to cleanly drain requests