forked from fediversity/fediversity
		
	minimum setup i got working for deployment
This commit is contained in:
		
							parent
							
								
									1d4004ccf4
								
							
						
					
					
						commit
						f828afd5d5
					
				
					 2 changed files with 19 additions and 4 deletions
				
			
		|  | @ -29,7 +29,7 @@ in | |||
|     secrets = { | ||||
|       SECRET_KEY = config.age.secrets.panel-secret-key.path; | ||||
|     }; | ||||
|     port = 80; | ||||
|     port = 8000; | ||||
|     settings = { | ||||
|       DATABASE_URL = "sqlite:///var/lib/${name}/db.sqlite3"; | ||||
|       CREDENTIALS_DIRECTORY = "/var/lib/${name}/.credentials"; | ||||
|  |  | |||
|  | @ -26,10 +26,19 @@ let | |||
|   database-url = "sqlite:////var/lib/${name}/db.sqlite3"; | ||||
| 
 | ||||
|   python-environment = pkgs.python3.withPackages ( | ||||
|     ps: with ps; [ | ||||
|       cfg.package | ||||
|     ps: | ||||
|     with ps; | ||||
|     [ | ||||
|       uvicorn | ||||
|       cfg.package | ||||
|       dj-database-url | ||||
|       django-compressor | ||||
|       django-debug-toolbar | ||||
|       django-libsass | ||||
|       django_4 | ||||
|       setuptools | ||||
|     ] | ||||
|     ++ cfg.package.propagatedBuildInputs | ||||
|   ); | ||||
| 
 | ||||
|   configFile = pkgs.concatText "configuration.py" [ | ||||
|  | @ -180,7 +189,8 @@ in | |||
|         fi | ||||
|       ''; | ||||
|       script = '' | ||||
|         uvicorn ${name}.asgi:application --host ${cfg.host} --port ${toString cfg.port} | ||||
|         export PYTHONPATH=$PYTHONPATH:${cfg.package}/lib/python3.12/site-packages | ||||
|         ${python-environment}/bin/python -m uvicorn ${name}.asgi:application --host ${cfg.host} --port ${toString cfg.port} | ||||
|       ''; | ||||
|       serviceConfig = { | ||||
|         Restart = "always"; | ||||
|  | @ -195,5 +205,10 @@ in | |||
|         DATABASE_URL = database-url; | ||||
|       }; | ||||
|     }; | ||||
| 
 | ||||
|     networking.firewall.allowedTCPPorts = [ | ||||
|       80 | ||||
|       443 | ||||
|     ]; | ||||
|   }; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue