From 86c5a505ffde519055609fcc59f83b46b0f7d2c2 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 10 Apr 2024 07:09:43 +0300 Subject: 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 --- genenetwork/services/genenetwork.scm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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{} record." (define (gn-uploader-nginx-server-block config) (match-record config - (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) ";") -- cgit v1.2.3