mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-28 16:45:32 +00:00
added docker image
This commit is contained in:
11
docker-compose.yml
Normal file
11
docker-compose.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
services:
|
||||
kgpz_web:
|
||||
build: .
|
||||
volumes:
|
||||
- kgpz_data:/app/data_git
|
||||
ports:
|
||||
- "8000:8080"
|
||||
|
||||
volumes:
|
||||
kgpz_data:
|
||||
external: true
|
||||
23
dockerfile
Normal file
23
dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
FROM node:lts-alpine
|
||||
COPY . /source
|
||||
|
||||
RUN apk add --no-cache \
|
||||
unzip \
|
||||
ca-certificates \
|
||||
build-base
|
||||
|
||||
|
||||
ADD https://go.dev/dl/go1.23.2.linux-amd64.tar.gz /tmp/go.tar.gz
|
||||
RUN tar -C /usr/local -xzf /tmp/go.tar.gz
|
||||
RUN export PATH=$PATH:/usr/local/go/bin
|
||||
|
||||
WORKDIR /source
|
||||
RUN rm -rf ./data_git/
|
||||
RUN rm -rf ./cache_gnd/
|
||||
RUN npm --prefix ./views install
|
||||
RUN npm --prefix ./views run build -- --config vite.config.js
|
||||
RUN /usr/local/go/bin/go build -o /app/kgpz .
|
||||
COPY ./config.dev.json /app/config.dev.json
|
||||
|
||||
WORKDIR /app
|
||||
CMD ["/app/kgpz"]
|
||||
18
functions/iterables.go
Normal file
18
functions/iterables.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package functions
|
||||
|
||||
func MapArrayInsert[K comparable, V any](m map[K][]V, k K, v V) {
|
||||
l, ok := m[k]
|
||||
if !ok {
|
||||
m[k] = []V{v}
|
||||
} else {
|
||||
m[k] = append(l, v)
|
||||
}
|
||||
}
|
||||
|
||||
func Keys[K comparable, V any](m map[K]V) []K {
|
||||
keys := make([]K, 0, len(m))
|
||||
for k := range m {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
return keys
|
||||
}
|
||||
12
functions/sorting.go
Normal file
12
functions/sorting.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package functions
|
||||
|
||||
import (
|
||||
"golang.org/x/text/collate"
|
||||
"golang.org/x/text/language"
|
||||
)
|
||||
|
||||
func Sort(s []string) []string {
|
||||
c := collate.New(language.German, collate.IgnoreCase)
|
||||
c.SortStrings(s)
|
||||
return s
|
||||
}
|
||||
Reference in New Issue
Block a user