Add initial support for solr
This commit is contained in:
parent
7bedeefb50
commit
b27871f39a
13 changed files with 131 additions and 31 deletions
1
internal/dis/component/solr/solr.env
Normal file
1
internal/dis/component/solr/solr.env
Normal file
|
|
@ -0,0 +1 @@
|
|||
DOCKER_NETWORK_NAME=${DOCKER_NETWORK_NAME}
|
||||
48
internal/dis/component/solr/solr.go
Normal file
48
internal/dis/component/solr/solr.go
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
package solr
|
||||
|
||||
import (
|
||||
"context"
|
||||
"embed"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/environment"
|
||||
)
|
||||
|
||||
type Solr struct {
|
||||
component.Base
|
||||
|
||||
BaseURL string // upstream solr url
|
||||
|
||||
PollContext context.Context // context to abort polling with
|
||||
PollInterval time.Duration // duration to wait for during wait
|
||||
}
|
||||
|
||||
func (s *Solr) Path() string {
|
||||
return filepath.Join(s.Still.Config.DeployRoot, "core", "solr")
|
||||
}
|
||||
|
||||
func (*Solr) Context(parent component.InstallationContext) component.InstallationContext {
|
||||
return parent
|
||||
}
|
||||
|
||||
//go:embed all:solr
|
||||
//go:embed solr.env
|
||||
var resources embed.FS
|
||||
|
||||
func (solr *Solr) Stack(env environment.Environment) component.StackWithResources {
|
||||
return component.MakeStack(solr, env, component.StackWithResources{
|
||||
Resources: resources,
|
||||
ContextPath: "solr",
|
||||
|
||||
EnvPath: "solr.env",
|
||||
EnvContext: map[string]string{
|
||||
"DOCKER_NETWORK_NAME": solr.Config.DockerNetworkName,
|
||||
},
|
||||
|
||||
MakeDirs: []string{
|
||||
filepath.Join("data"),
|
||||
},
|
||||
})
|
||||
}
|
||||
18
internal/dis/component/solr/solr/docker-compose.yml
Normal file
18
internal/dis/component/solr/solr/docker-compose.yml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
version: "3.7"
|
||||
|
||||
services:
|
||||
solr:
|
||||
image: docker.io/library/solr:8.11-slim
|
||||
ports:
|
||||
- "127.0.0.1:8983:8983"
|
||||
volumes:
|
||||
- './data/:/var/solr'
|
||||
labels:
|
||||
- "eu.wiss-ki.barrel.distillery=${DOCKER_NETWORK_NAME}"
|
||||
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
default:
|
||||
name: ${DOCKER_NETWORK_NAME}
|
||||
external: true
|
||||
Loading…
Add table
Add a link
Reference in a new issue