mirror of
				https://git.tt-rss.org/fox/ttrss-docker-compose
				synced 2025-11-04 09:24:13 +01:00 
			
		
		
		
	1. move .env to .env-dist so local customization is not clashing with the
repo 2. rewrite SELF_URL_PATH based on configured value even if config.php exists 3. update README
This commit is contained in:
		
							parent
							
								
									05d341df89
								
							
						
					
					
						commit
						9b0a93677d
					
				
					 4 changed files with 21 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,6 @@
 | 
			
		|||
# Copy this file to .env before building the container.
 | 
			
		||||
# Put any local modifications here.
 | 
			
		||||
 | 
			
		||||
POSTGRES_USER=postgres
 | 
			
		||||
POSTGRES_PASSWORD=password
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1
									
								
								.gitignore
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
										
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
.env
 | 
			
		||||
							
								
								
									
										13
									
								
								README.md
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								README.md
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -23,12 +23,21 @@ The general outline of the configuration is as follows:
 | 
			
		|||
git clone https://git.tt-rss.org/fox/ttrss-docker-compose.git ttrss-docker && cd ttrss-docker
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### Edit ``.env`` and/or ``docker-compose.yml`` if necessary
 | 
			
		||||
#### Edit configuration files:
 | 
			
		||||
 | 
			
		||||
You will probably have to edit ``SELF_URL_PATH`` which should equal fully qualified tt-rss
 | 
			
		||||
Copy ``.env-dist`` to ``.env`` and edit any relevant variables you need changed.
 | 
			
		||||
 | 
			
		||||
* You will likely have to change ``SELF_URL_PATH`` which should equal fully qualified tt-rss
 | 
			
		||||
URL as seen when opening it in your web browser. If this field is set incorrectly, you will
 | 
			
		||||
likely see the correct value in the tt-rss fatal error message.
 | 
			
		||||
 | 
			
		||||
Note: ``SELF_URL_PATH`` is updated in generated tt-rss ``config.php`` automatically on container
 | 
			
		||||
restart.
 | 
			
		||||
 | 
			
		||||
* By default, container binds to **localhost** port **8280**. If you want the container to be
 | 
			
		||||
accessible on the net, without using a reverse proxy sharing same host, you will need to
 | 
			
		||||
remove ``127.0.0.1:`` from ``HTTP_PORT`` variable in ``.env``.
 | 
			
		||||
 | 
			
		||||
#### Build and start the container
 | 
			
		||||
 | 
			
		||||
``docker-compose up``
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -48,9 +48,9 @@ elif ! $PSQL -c 'select * from ttrss_version'; then
 | 
			
		|||
	$PSQL < /var/www/html/tt-rss/schema/ttrss_schema_pgsql.sql
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [ ! -s $DST_DIR/config.php ]; then
 | 
			
		||||
	SELF_URL_PATH=$(echo $SELF_URL_PATH | sed -e 's/[\/&]/\\&/g')
 | 
			
		||||
SELF_URL_PATH=$(echo $SELF_URL_PATH | sed -e 's/[\/&]/\\&/g')
 | 
			
		||||
 | 
			
		||||
if [ ! -s $DST_DIR/config.php ]; then
 | 
			
		||||
	sed \
 | 
			
		||||
		-e "s/define('DB_HOST'.*/define('DB_HOST', '$DB_HOST');/" \
 | 
			
		||||
		-e "s/define('DB_USER'.*/define('DB_USER', '$DB_USER');/" \
 | 
			
		||||
| 
						 | 
				
			
			@ -63,7 +63,10 @@ if [ ! -s $DST_DIR/config.php ]; then
 | 
			
		|||
	cat >> $DST_DIR/config.php << EOF
 | 
			
		||||
		define('NGINX_XACCEL_PREFIX', '/tt-rss');
 | 
			
		||||
EOF
 | 
			
		||||
	
 | 
			
		||||
else
 | 
			
		||||
	sed \
 | 
			
		||||
		-e "s/define('SELF_URL_PATH'.*/define('SELF_URL_PATH','$SELF_URL_PATH');/" \
 | 
			
		||||
		-i.bak $DST_DIR/config.php
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
crond &
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue