diff options
author | Frederick Muriuki Muriithi | 2024-04-10 07:09:43 +0300 |
---|---|---|
committer | Arun Isaac | 2024-05-07 14:09:31 +0100 |
commit | 86c5a505ffde519055609fcc59f83b46b0f7d2c2 (patch) | |
tree | 34b040deaa8c430c3b358b0dd06d028876071850 /genenetwork/services/genenetwork.scm | |
parent | 7e2d03f4f2534c94589ae723a331e39b30a1b818 (diff) | |
download | gn-machines-86c5a505ffde519055609fcc59f83b46b0f7d2c2.tar.gz |
gn-uploader: Serve static files via nginx.
* genenetwork/services/genenetwork.scm: Import nginx from (gnu
packages web), python from (gnu packages python), (guix build
python-build-system) and (guix packages).
(gn-uploader-nginx-server-block): Serve static files via nginx.
Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
Diffstat (limited to 'genenetwork/services/genenetwork.scm')
-rw-r--r-- | genenetwork/services/genenetwork.scm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/genenetwork/services/genenetwork.scm b/genenetwork/services/genenetwork.scm index b13d006..4f3b069 100644 --- a/genenetwork/services/genenetwork.scm +++ b/genenetwork/services/genenetwork.scm @@ -21,12 +21,16 @@ (define-module (genenetwork services genenetwork) #:use-module ((gn packages genenetwork) #:select (genenetwork2 genenetwork3 gn-auth gn-uploader)) + #:use-module ((gnu packages web) #:select (nginx)) #:use-module ((gnu packages admin) #:select (shadow)) + #:use-module ((gnu packages python) #:select (python)) #:use-module (gnu services) #:use-module (gnu services web) #:use-module (gnu system file-systems) #:use-module (gnu system shadow) + #:use-module (guix build python-build-system) #:use-module (guix gexp) + #:use-module (guix packages) #:use-module (guix profiles) #:use-module (guix records) #:use-module (forge environment) @@ -451,11 +455,19 @@ a @code{<genenetwork-configuration>} record." (define (gn-uploader-nginx-server-block config) (match-record config <gn-uploader-configuration> - (server-name port) + (server-name port gn-uploader) (list (nginx-server-configuration (server-name (list server-name)) (locations (list (nginx-location-configuration + (uri "/static") + (body + (list #~(string-append "root " + #$(file-append gn-uploader + "/lib/python" + (python-version (package-version python)) + "/site-packages/qc_app;"))))) + (nginx-location-configuration (uri "/") (body (list (string-append "proxy_pass http://localhost:" (number->string port) ";") |