-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (35 loc) · 1.35 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
FROM maven:3.9.9-eclipse-temurin-21 AS build
WORKDIR /usr/src/app
COPY pom.xml .
COPY .mvn .mvn
COPY cli ./cli
COPY core ./core
COPY service ./service
COPY tools ./tools
COPY web ./web
RUN mvn clean install -DskipTests --batch-mode
RUN cd web && mvn clean package -DskipTests --batch-mode
FROM ollama/ollama:latest
# GitHub overrides the HOME environment variable, which is where the models
# are stored by default. We override the default location to a directory
# that we control.
RUN mkdir -p /ollama/models
ENV OLLAMA_MODELS /ollama/models
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update \
&& apt-get install -y curl openjdk-21-jre-headless \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -#LO https://github.com/atkrad/wait4x/releases/latest/download/wait4x-linux-amd64.tar.gz \
&& tar --one-top-level -xvf wait4x-linux-amd64.tar.gz \
&& cp ./wait4x-linux-amd64/wait4x /usr/local/bin/wait4x \
&& rm wait4x-linux-amd64.tar.gz
RUN nohup bash -c "ollama serve &" \
&& wait4x http http://127.0.0.1:11434 \
&& ollama pull qwen2.5-coder \
&& ollama pull llama3.2:3b \
&& ollama list
COPY --from=build /usr/src/app/cli/target/secondbrain-cli-*.jar /usr/local/bin/secondbrain-cli.jar
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]