From ecb9f621180c8745401d073fadfc98eec6be9062 Mon Sep 17 00:00:00 2001 From: Darren <27513732@qq.com> Date: Thu, 7 Dec 2023 17:18:32 +0800 Subject: [PATCH] restart docker only install --- docker/docker-compose.yml | 3 ++- docker/git/README.md | 9 ++++++++- docker/git/src/config/app.ini.example | 3 +++ install/install.sh | 9 +++++++-- install/install_docker.sh | 5 ++++- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index c00d1729..48a9c3f7 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -47,7 +47,8 @@ services: - DISABLE_SSH=true - RUN_MODE=prod - HTTP_PORT=3000 - - DISABLE_REGISTRATION=false + - DISABLE_REGISTRATION=true + - GITEA__server__OFFLINE_MODE=true - REQUIRE_SIGNIN_VIEW=false - ROOT_URL=http://localhost/w9git/ labels: diff --git a/docker/git/README.md b/docker/git/README.md index 6babbcc2..ac3d8eaa 100644 --- a/docker/git/README.md +++ b/docker/git/README.md @@ -2,10 +2,17 @@ ## Development -From official Gitea image, and: +### What do done? + +From official Gitea image, we have complete these modification: - Complete install wizard automaticlly by enviroment INSTALL_LOCK - Use default URL localhost for Host/Root_URL settings +- create administrator user + +### Environments + +Any app.ini items can set by environment, refer to [Managing Deployments With Environment Variables](https://docs.gitea.com/installation/install-with-docker#managing-deployments-with-environment-variables) ## User diff --git a/docker/git/src/config/app.ini.example b/docker/git/src/config/app.ini.example index afd3ce02..3ee7d603 100644 --- a/docker/git/src/config/app.ini.example +++ b/docker/git/src/config/app.ini.example @@ -1,3 +1,6 @@ +# This file only for your reference, it maybe not always update +# it from: https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini + APP_NAME = gitea RUN_MODE = prod RUN_USER = git diff --git a/install/install.sh b/install/install.sh index cdfafcd5..46f7fb8c 100644 --- a/install/install.sh +++ b/install/install.sh @@ -362,7 +362,10 @@ set_docker(){ sudo systemctl stop firewalld sudo systemctl disable firewalld fi - sudo systemctl restart docker + + if [ "$execute_mode" = "install" ]; then + sudo systemctl restart docker + fi } install_backends() { @@ -484,7 +487,9 @@ if [ $? -ne 0 ]; then fi echo "Restart Docker for Firewalld..." -sudo systemctl restart docker +if [ "$execute_mode" = "install" ]; then + sudo systemctl restart docker +fi endtime=$(date +%s) runtime=$((endtime-starttime)) diff --git a/install/install_docker.sh b/install/install_docker.sh index 2f0005b5..f103c457 100644 --- a/install/install_docker.sh +++ b/install/install_docker.sh @@ -162,4 +162,7 @@ fi echo -e "\n\n-------- Docker --------" Upgrade_Docker -Start_Docker \ No newline at end of file + +if [ -z "$execute_mode" ] || [ "$execute_mode" = "install" ]; then + Start_Docker +fi \ No newline at end of file