-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
54 lines (44 loc) · 1.41 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Base image
FROM golang:1.23.3-alpine3.20 as build
# Install fuseki
RUN apk update && apk add \
wget \
unzip \
git \
nodejs \
npm
WORKDIR /opt
RUN wget https://dlcdn.apache.org/jena/binaries/apache-jena-fuseki-5.2.0.tar.gz && \
tar xzf apache-jena-fuseki-5.2.0.tar.gz && \
rm apache-jena-fuseki-5.2.0.tar.gz && \
mv apache-jena-fuseki-5.2.0 fuseki
COPY shiro.ini /opt/fuseki/shiro.ini
# Build PrivGuide
RUN git clone https://github.com/ATNoG/rigourous-devprivops.git /privguide_src
WORKDIR /privguide_src
RUN go mod tidy && \
go build
# Build UI
COPY . /src
WORKDIR /src
RUN go install github.com/a-h/templ/cmd/templ@latest && \
templ generate && \
npm install -D tailwindcss && \
npx tailwindcss -i static/css/source.css -o static/css/style.css --minify && \
go mod tidy && \
go build
# Execution environment
FROM alpine:latest
# Add runtime dependencies
RUN apk update && apk add \
openjdk21-jre \
git
# Get executables and static directory
COPY --from=build /opt/fuseki /opt/fuseki
COPY --from=build /privguide_src/devprivops /usr/local/bin/
COPY --from=build /src/devprivops-ui /usr/local/bin/
COPY --from=build /src/static/ /var/www/privguide/static
# Allow host directories to be used as git repositories, fixing "dubious ownership"
RUN git config --system --add safe.directory '*'
# Start fuseki server
CMD /opt/fuseki/fuseki-server --mem --port=3030 /tmp & devprivops-ui