mirror of
				https://github.com/factoriotools/factorio-docker.git
				synced 2025-10-31 00:48:07 +01:00 
			
		
		
		
	#197: Enable envsubst - README
This commit is contained in:
		
							
								
								
									
										25
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								README.md
									
									
									
									
									
								
							| @@ -182,6 +182,31 @@ Create file `config/server-adminlist.json` and add the adminlisted users. | ||||
|         "friend" | ||||
|     ] | ||||
|  | ||||
| ## Customize configuration files | ||||
|  | ||||
| Out-of-the box, factorio does not support environment variables inside the configuration files. A workaround is the usage of `envsubst` which generates the configuration files dynamically during startup. | ||||
|  | ||||
| Example for server-settings.json: | ||||
|  | ||||
|  | ||||
| 	factorio_1: | ||||
| 	  image: dtanders/factorio | ||||
| 	  ports: | ||||
| 	    - "34197:34197/udp" | ||||
| 	  volumes: | ||||
| 	   - /opt/factorio:/factorio | ||||
| 	   - ./server-settings.json:/server-settings.json | ||||
| 	  environment: | ||||
| 	    - INSTANCE_NAME=Your Instance's Name | ||||
| 	    - INSTANCE_DESC=Your Instance's Description | ||||
| 	  entrypoint: /bin/sh -c "envsubst < /server-settings.json > /factorio/config/server-settings.json && exec /docker-entrypoint.sh" | ||||
|  | ||||
| The `server-settings.json` file may then contain the variable references like this: | ||||
|  | ||||
| 	"name": "${INSTANCE_NAME}", | ||||
| 	"description": "${INSTANCE_DESC}", | ||||
|  | ||||
|  | ||||
| # Container Details | ||||
|  | ||||
| The philosophy is to [keep it simple](http://wiki.c2.com/?KeepItSimple). | ||||
|   | ||||
		Reference in New Issue
	
	Block a user