mirror of
				https://github.com/zokradonh/kopano-docker
				synced 2025-10-31 02:17:47 +00:00 
			
		
		
		
	Add dynamic dependency-wait for server and spooler service. (#119)
* Add dynamic dependency-wait for server and spooler service. Instead of using hard-coded dependency-waits on startup for database and MTA for the server and spooler, respectively, the actually configured values are now used. For the servers, this also takes the use of a unix file socket over a network socket into account.
This commit is contained in:
		
							parent
							
								
									71f88b8451
								
							
						
					
					
						commit
						29839286ad
					
				| @ -1,6 +1,7 @@ | ||||
| #!/bin/bash | ||||
| 
 | ||||
| ADDITIONAL_KOPANO_PACKAGES=${ADDITIONAL_KOPANO_PACKAGES:-""} | ||||
| KCCONF_SERVER_MYSQL_SOCKET=${KCCONF_SERVER_MYSQL_SOCKET:-""} | ||||
| 
 | ||||
| set -eu # unset variables are errors & non-zero return values exit the whole script | ||||
| 
 | ||||
| @ -38,12 +39,18 @@ fi | ||||
| # start regular service | ||||
| case "$SERVICE_TO_START" in | ||||
| server) | ||||
| 	# determine db connection mode (unix vs. network socket) | ||||
| 	if [ -n "$KCCONF_SERVER_MYSQL_SOCKET" ]; then | ||||
| 		DB_CONN="file://$KCCONF_SERVER_MYSQL_SOCKET" | ||||
| 	else | ||||
| 		DB_CONN="tcp://$KCCONF_SERVER_MYSQL_HOST:$KCCONF_SERVER_MYSQL_PORT" | ||||
| 	fi | ||||
| 	/kopano/services/kopano-public-store.sh & | ||||
| 	/kopano/services/kopano-users.sh & | ||||
| 	dockerize \ | ||||
| 		-wait file://"$KCCONF_SERVER_SERVER_SSL_CA_FILE" \ | ||||
| 		-wait file://"$KCCONF_SERVER_SERVER_SSL_KEY_FILE" \ | ||||
| 		-wait tcp://db:3306 \ | ||||
| 		-wait "$DB_CONN" \ | ||||
| 		-timeout 360s | ||||
| 	# cleaning up env variables | ||||
| 	unset "${!KCCONF_@}" | ||||
| @ -115,7 +122,7 @@ search) | ||||
| spooler) | ||||
| 	dockerize \ | ||||
| 		-wait file://var/run/kopano/server.sock \ | ||||
| 		-wait tcp://mail:25 \ | ||||
| 		-wait tcp://"$KCCONF_SPOOLER_SMTP_SERVER":25 \ | ||||
| 		-timeout 1080s | ||||
| 	# cleaning up env variables | ||||
| 	unset "${!KCCONF_@}" | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user