mirror of
				https://github.com/samply/bridgehead.git
				synced 2025-11-04 01:20:17 +01:00 
			
		
		
		
	Merge pull request #140 from samply/feature/dnpm-node
Feature/dnpm node
This commit is contained in:
		
							
								
								
									
										33
									
								
								bbmri/modules/dnpm-node-compose.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								bbmri/modules/dnpm-node-compose.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
version: "3.7"
 | 
			
		||||
 | 
			
		||||
services:
 | 
			
		||||
  dnpm-backend:
 | 
			
		||||
    image: ghcr.io/kohlbacherlab/bwhc-backend:1.0-snapshot-broker-connector
 | 
			
		||||
    container_name: bridgehead-dnpm-backend
 | 
			
		||||
    environment:
 | 
			
		||||
      - ZPM_SITE=${ZPM_SITE}
 | 
			
		||||
    volumes:
 | 
			
		||||
      - /etc/bridgehead/dnpm:/bwhc_config:ro
 | 
			
		||||
      - ${DNPM_DATA_DIR}:/bwhc_data
 | 
			
		||||
    labels:
 | 
			
		||||
      - "traefik.enable=true"
 | 
			
		||||
      - "traefik.http.routers.bwhc-backend.rule=PathPrefix(`/bwhc`)"
 | 
			
		||||
      - "traefik.http.services.bwhc-backend.loadbalancer.server.port=9000"
 | 
			
		||||
      - "traefik.http.routers.bwhc-backend.tls=true"
 | 
			
		||||
 | 
			
		||||
  dnpm-frontend:
 | 
			
		||||
    image: ghcr.io/kohlbacherlab/bwhc-frontend:2209
 | 
			
		||||
    container_name: bridgehead-dnpm-frontend
 | 
			
		||||
    links:
 | 
			
		||||
      - dnpm-backend
 | 
			
		||||
    environment:
 | 
			
		||||
      - NUXT_HOST=0.0.0.0
 | 
			
		||||
      - NUXT_PORT=8080
 | 
			
		||||
      - BACKEND_PROTOCOL=https
 | 
			
		||||
      - BACKEND_HOSTNAME=$HOST
 | 
			
		||||
      - BACKEND_PORT=443
 | 
			
		||||
    labels:
 | 
			
		||||
      - "traefik.enable=true"
 | 
			
		||||
      - "traefik.http.routers.bwhc-frontend.rule=PathPrefix(`/`)"
 | 
			
		||||
      - "traefik.http.services.bwhc-frontend.loadbalancer.server.port=8080"
 | 
			
		||||
      - "traefik.http.routers.bwhc-frontend.tls=true"
 | 
			
		||||
							
								
								
									
										27
									
								
								bbmri/modules/dnpm-node-setup.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								bbmri/modules/dnpm-node-setup.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
if [ -n "${ENABLE_DNPM_NODE}" ]; then
 | 
			
		||||
	log INFO "DNPM setup detected (BwHC Node) -- will start BwHC node."
 | 
			
		||||
	OVERRIDE+=" -f ./$PROJECT/modules/dnpm-node-compose.yml"
 | 
			
		||||
 | 
			
		||||
	# Set variables required for BwHC Node. ZPM_SITE is assumed to be set in /etc/bridgehead/<project>.conf
 | 
			
		||||
	DNPM_APPLICATION_SECRET="$(echo \"This is a salt string to generate one consistent password for DNPM. It is not required to be secret.\" | sha1sum | openssl pkeyutl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)"
 | 
			
		||||
	if [ -z "${ZPM_SITE+x}" ]; then
 | 
			
		||||
		log ERROR "Mandatory variable ZPM_SITE not defined!"
 | 
			
		||||
		exit 1
 | 
			
		||||
	fi
 | 
			
		||||
	if [ -z "${DNPM_DATA_DIR+x}" ]; then
 | 
			
		||||
		log ERROR "Mandatory variable DNPM_DATA_DIR not defined!"
 | 
			
		||||
		exit 1
 | 
			
		||||
	fi
 | 
			
		||||
			if grep -q 'traefik.http.routers.landing.rule=PathPrefix(`/landing`)' /srv/docker/bridgehead/minimal/docker-compose.override.yml 2>/dev/null; then
 | 
			
		||||
				echo "Override of landing page url already in place"
 | 
			
		||||
			else
 | 
			
		||||
				echo "Adding override of landing page url"
 | 
			
		||||
				if [ -f /srv/docker/bridgehead/minimal/docker-compose.override.yml ]; then
 | 
			
		||||
					echo -e '  landing:\n    labels:\n      - "traefik.http.routers.landing.rule=PathPrefix(`/landing`)"' >> /srv/docker/bridgehead/minimal/docker-compose.override.yml
 | 
			
		||||
				else
 | 
			
		||||
					echo -e 'version: "3.7"\nservices:\n  landing:\n    labels:\n      - "traefik.http.routers.landing.rule=PathPrefix(`/landing`)"' >> /srv/docker/bridgehead/minimal/docker-compose.override.yml
 | 
			
		||||
				fi
 | 
			
		||||
			fi
 | 
			
		||||
fi
 | 
			
		||||
		Reference in New Issue
	
	Block a user