From 276b25403d89a631db6c665ca6c168be28315c94 Mon Sep 17 00:00:00 2001 From: chendelin1982 <27513732@qq.com> Date: Tue, 19 Sep 2023 18:30:33 +0800 Subject: [PATCH] docker --- docker/docker-compose.yml | 156 +++++++++++++++++++------------------- install/install_new.sh | 23 ++---- install/intall_cockpit.sh | 11 +++ 3 files changed, 95 insertions(+), 95 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 435c15f9..e8c73dfd 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,79 +1,79 @@ -version: "3.8" - -services: - apphub: - image: websoft9dev/apphub:$APP_VERSION - container_name: websoft9-apphub - ports: - - 127.0.0.1:9001:8080 - restart: always - volumes: - - apphub_logs:/websoft9/apphub/logs - - apphub_media:/websoft9/media - - apphub_config:/websoft9/apphub/src/conf - depends_on: - - deployment - - git - - proxy - - deployment: - image: websoft9dev/deployment:2.19.0 - container_name: websoft9-deployment - restart: always - ports: - - 9001-9999:9000 - volumes: - - portainer:/data - - /var/run/docker.sock:/var/run/docker.sock - labels: - com.docker.compose.w9_http.port: 9000 - - git: - image: websoft9dev/git:$APP_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: jc21/nginx-proxy-manager:${APP_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: +version: "3.8" + +services: + apphub: + image: websoft9dev/apphub:$APPHUB_VERSION + container_name: websoft9-apphub + ports: + - 127.0.0.1:9001:8080 + restart: always + volumes: + - apphub_logs:/websoft9/apphub/logs + - apphub_media:/websoft9/media + - apphub_config:/websoft9/apphub/src/conf + depends_on: + - deployment + - git + - proxy + + deployment: + image: websoft9dev/deployment:$DEPLOYMENT_VERSION + container_name: websoft9-deployment + restart: always + ports: + - 9001-9999:9000 + volumes: + - portainer:/data + - /var/run/docker.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: jc21/nginx-proxy-manager:$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 diff --git a/install/install_new.sh b/install/install_new.sh index 29057d1e..61fcda5e 100644 --- a/install/install_new.sh +++ b/install/install_new.sh @@ -4,14 +4,6 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin # Export PATH export PATH -# Define error_exit function -function error_exit { - echo "$1" 1>&2 - exit 1 -} - -# Trap ERR signal and call error_exit function -trap 'error_exit "Please push issue to: https://github.com/Websoft9/stackhub/issues"' ERR # Define vars install_path="/data/websoft9" @@ -21,24 +13,21 @@ if [[ "$1" == "dev" ]]; then urls="https://w9artifact.blob.core.windows.net/dev/websoft9" fi -# Download and extract source code -wget $urls/websoft9.latest && unzip websoft9.latest $install_path - # Install runtime -curl https://websoft9.github.io/websoft9/install/install_tools.sh | bash -curl https://websoft9.github.io/websoft9/install/install_docker.sh | bash +bash install_tools.sh +bash install_docker.sh # Install Cockpit and plugins -curl https://websoft9.github.io/websoft9/install/install_cockpit.sh | bash -curl https://websoft9.github.io/websoft9/install/install_plugins.sh | bash +bash install_cockpit.sh +bash install_plugins.sh # Install backend service cd $install_path/docker sudo docker network create websoft9 -sudo docker-compose -p websoft9 up -d +sudo docker compose -p websoft9 up -d # Install Systemd service -cd $install_path/websoft9/systemd +cd $install_path/systemd sudo systemctl daemon-reload sudo systemctl enable websoft9.service sudo systemctl start websoft9 \ No newline at end of file diff --git a/install/intall_cockpit.sh b/install/intall_cockpit.sh index 47bffea1..b09a6127 100644 --- a/install/intall_cockpit.sh +++ b/install/intall_cockpit.sh @@ -1,3 +1,14 @@ +#!/bin/bash +# Define PATH +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +# Export PATH +export PATH + + +CheckEnvironment +InstallCockpit + + function get_os_type() { if [ -f /etc/os-release ]; then . /etc/os-release