Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chendelin1982 authored Oct 24, 2023
1 parent 903d7cd commit a4559ee
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
20 changes: 11 additions & 9 deletions docker/apphub/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
# modify time: 202310241440, you can modify here to trigger Docker Build action
# modify time: 202310241441, you can modify here to trigger Docker Build action

FROM python:3.10-bullseye AS buildstage
LABEL maintainer="Websoft9<[email protected]>"
LABEL version="0.0.6"

ENV LIBRARY_VERSION=v0.5.8
ENV MEDIA_VERSION=0.0.3

# Prepare library
# Prepare source files
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 && \

wget https://github.com/Websoft9/media/archive/refs/tags/$MEDIA_VERSION.zip -O ./media.zip && \
unzip media.zip && \
mv media-* media && \

# 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 /media ./media
COPY --from=buildstage /library ./library
COPY --from=buildstage /websoft9/apphub ./apphub
COPY --from=buildstage /swagger-ui/dist ./apphub/swagger-ui

RUN apt update && apt install git jq iproute2 supervisor -y && \
RUN apt update && apt install curl git jq iproute2 supervisor -y && \
mkdir credentials && \
echo "This folder stored the credentials of other services that integrated with apphub" > credentials/readme

Expand All @@ -41,7 +44,6 @@ 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
Expand Down
16 changes: 6 additions & 10 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,14 @@ check_ports() {

echo "Stop Websoft9 Proxy and Cockpit service for reserve ports..."
sudo docker stop websoft9-proxy 2>/dev/null || echo "docker stop websoft9-proxy not need "
sudo systemctl stop cockpit 2>/dev/null || echo "systemctl stop cockpit not need"
sudo systemctl stop cockpit.socket 2>/dev/null || echo "systemctl stop cockpit.socket not need"


for port in "${ports[@]}"; do
if ss -tuln | grep ":$port " >/dev/null; then
echo "Port $port is in use, install failed"
if ss -tuln | grep ":$port " >/dev/null && ! systemctl status cockpit.socket | grep "$port" >/dev/null; then
echo "Port $port is in use or not in cockpit.socket, install failed"
exit
fi
done


echo "All ports are available"
}

Expand Down Expand Up @@ -334,8 +330,9 @@ install_backends() {


install_systemd() {
echo -e "\n\n-------- Systemd --------"
echo_prefix_systemd=$'\n[Systemd] - '
echo "$echo_prefix_systemdInstall Systemd service"
echo "$echo_prefix_systemd Install Systemd service"

if [ ! -d "$systemd_path" ]; then
sudo mkdir -p "$systemd_path"
Expand Down Expand Up @@ -382,6 +379,8 @@ fi

install_backends

install_systemd

bash $install_path/install/install_cockpit.sh
if [ $? -ne 0 ]; then
echo "install_cockpit failed with error $?. Exiting."
Expand All @@ -397,9 +396,6 @@ fi
echo "Restart Docker for Firewalld..."
sudo systemctl restart docker

install_systemd


endtime=$(date +%s)
runtime=$((endtime-starttime))
echo "Script execution time: $runtime seconds"
Expand Down
2 changes: 1 addition & 1 deletion install/install_cockpit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ echo "install_path:$install_path"
related_containers=("websoft9-apphub")
echo_prefix_cockpit=$'\n[Cockpit] - '
# package cockpit depends_on [cockpit-bridge,cockpit-ws,cockpit-system], but update cockpit the depends don't update
cockpit_packages="cockpit cockpit-ws cockpit-bridge cockpit-system cockpit-pcp cockpit-storaged cockpit-networkmanager cockpit-session-recording cockpit-doc cockpit-packagekit cockpit-sosreport"
cockpit_packages="cockpit cockpit-ws cockpit-bridge cockpit-system cockpit-pcp cockpit-networkmanager cockpit-session-recording cockpit-doc cockpit-packagekit cockpit-sosreport"
menu_overrides_github_page_url="https://websoft9.github.io/websoft9/cockpit/menu_override"
cockpit_config_github_page_url="https://websoft9.github.io/websoft9/cockpit/cockpit.conf"
cockpit_menu_overrides=()
Expand Down

0 comments on commit a4559ee

Please sign in to comment.