mirror of
				https://git.tt-rss.org/fox/ttrss-docker-compose
				synced 2025-11-04 09:24:13 +01:00 
			
		
		
		
	prevent updater from failing repeatedly on first startup while app volume is not ready
This commit is contained in:
		
							parent
							
								
									400fd5c1aa
								
							
						
					
					
						commit
						fa73a498a3
					
				
					 3 changed files with 26 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -9,6 +9,7 @@ RUN apk add --no-cache php7 php7-fpm \
 | 
			
		|||
	git postgresql-client sudo
 | 
			
		||||
 | 
			
		||||
ADD startup.sh /
 | 
			
		||||
ADD updater.sh /
 | 
			
		||||
ADD index.php /
 | 
			
		||||
 | 
			
		||||
RUN sed -i.bak 's/^listen = 127.0.0.1:9000/listen = 9000/' /etc/php7/php-fpm.d/www.conf
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										15
									
								
								app/updater.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										15
									
								
								app/updater.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,15 @@
 | 
			
		|||
#!/bin/sh -ex
 | 
			
		||||
 | 
			
		||||
while ! pg_isready -h $DB_HOST -U $DB_USER; do
 | 
			
		||||
	echo waiting until $DB_HOST is ready...
 | 
			
		||||
	sleep 3
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
DST_DIR=/var/www/html/tt-rss
 | 
			
		||||
 | 
			
		||||
while [ ! -s $DST_DIR/config.php ]; do
 | 
			
		||||
	echo waiting for $DST_DIR/config.php...
 | 
			
		||||
	sleep 3
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
exec /usr/bin/php /var/www/html/tt-rss/update_daemon2.php
 | 
			
		||||
| 
						 | 
				
			
			@ -43,12 +43,21 @@ services:
 | 
			
		|||
        - OWNER_UID=${OWNER_UID}
 | 
			
		||||
        - OWNER_GID=${OWNER_GID}
 | 
			
		||||
    restart: unless-stopped
 | 
			
		||||
    environment:
 | 
			
		||||
      - DB_TYPE=pgsql
 | 
			
		||||
      - DB_HOST=db
 | 
			
		||||
      - DB_NAME=${POSTGRES_USER}
 | 
			
		||||
      - DB_USER=${POSTGRES_USER}
 | 
			
		||||
      - DB_PASS=${POSTGRES_PASSWORD}
 | 
			
		||||
      - OWNER_UID=${OWNER_UID}
 | 
			
		||||
      - OWNER_GID=${OWNER_GID}
 | 
			
		||||
      - SELF_URL_PATH=${SELF_URL_PATH}
 | 
			
		||||
    volumes:
 | 
			
		||||
      - app:/var/www/html
 | 
			
		||||
    depends_on:
 | 
			
		||||
      - app
 | 
			
		||||
    user: app
 | 
			
		||||
    command: "php /var/www/html/tt-rss/update_daemon2.php"
 | 
			
		||||
    command: /updater.sh
 | 
			
		||||
 | 
			
		||||
  web:
 | 
			
		||||
    build: ./web
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue