restart docker only install

This commit is contained in:
Darren 2023-12-07 17:18:32 +08:00 committed by GitHub
parent ab6d247549
commit ecb9f62118
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 5 deletions

View File

@ -47,7 +47,8 @@ services:
- DISABLE_SSH=true - DISABLE_SSH=true
- RUN_MODE=prod - RUN_MODE=prod
- HTTP_PORT=3000 - HTTP_PORT=3000
- DISABLE_REGISTRATION=false - DISABLE_REGISTRATION=true
- GITEA__server__OFFLINE_MODE=true
- REQUIRE_SIGNIN_VIEW=false - REQUIRE_SIGNIN_VIEW=false
- ROOT_URL=http://localhost/w9git/ - ROOT_URL=http://localhost/w9git/
labels: labels:

View File

@ -2,10 +2,17 @@
## Development ## 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 - Complete install wizard automaticlly by enviroment INSTALL_LOCK
- Use default URL localhost for Host/Root_URL settings - 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 ## User

View File

@ -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 APP_NAME = gitea
RUN_MODE = prod RUN_MODE = prod
RUN_USER = git RUN_USER = git

View File

@ -362,7 +362,10 @@ set_docker(){
sudo systemctl stop firewalld sudo systemctl stop firewalld
sudo systemctl disable firewalld sudo systemctl disable firewalld
fi fi
sudo systemctl restart docker
if [ "$execute_mode" = "install" ]; then
sudo systemctl restart docker
fi
} }
install_backends() { install_backends() {
@ -484,7 +487,9 @@ if [ $? -ne 0 ]; then
fi fi
echo "Restart Docker for Firewalld..." echo "Restart Docker for Firewalld..."
sudo systemctl restart docker if [ "$execute_mode" = "install" ]; then
sudo systemctl restart docker
fi
endtime=$(date +%s) endtime=$(date +%s)
runtime=$((endtime-starttime)) runtime=$((endtime-starttime))

View File

@ -162,4 +162,7 @@ fi
echo -e "\n\n-------- Docker --------" echo -e "\n\n-------- Docker --------"
Upgrade_Docker Upgrade_Docker
Start_Docker
if [ -z "$execute_mode" ] || [ "$execute_mode" = "install" ]; then
Start_Docker
fi