-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (38 loc) · 1.41 KB
/
Dockerfile
File metadata and controls
50 lines (38 loc) · 1.41 KB
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
# Multi-stage build for Mnemosyne
# Stage 1: Build the Go binary
FROM golang:1.26-bookworm AS build
RUN apt-get update && apt-get install -y --no-install-recommends \
libsqlite3-dev gcc libc6-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 go build -o /mnemosyne ./cmd/mnemosyne
# Stage 2: Minimal runtime
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates libsqlite3-0 curl unzip \
&& rm -rf /var/lib/apt/lists/*
# Install Zenroom from GitHub releases
ENV ZENROOM_VERSION=5.31.2
RUN curl -fsSL -o /tmp/zenroom.zip \
https://github.com/dyne/Zenroom/releases/download/v${ZENROOM_VERSION}/zenroom-linux.zip \
&& unzip -o /tmp/zenroom.zip -d /tmp/zenroom-extract/ \
&& cp /tmp/zenroom-extract/zenroom-*/zenroom /usr/local/bin/zenroom \
&& chmod +x /usr/local/bin/zenroom \
&& rm -rf /tmp/zenroom.zip /tmp/zenroom-extract
COPY --from=build /mnemosyne /usr/local/bin/mnemosyne
COPY zenflows/ /zenflows/
COPY web/ /web/
ENV MNEMOSYNE_ADDR=:8546
ENV MNEMOSYNE_WEB=/web
ENV MNEMOSYNE_CONTRACTS=/zenflows
ENV MNEMOSYNE_DB=/data/mnemosyne.db
ENV ZENROOM_BIN=/usr/local/bin/zenroom
RUN mkdir -p /data
VOLUME /data
EXPOSE 8546
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -fsS http://localhost:8546/health || exit 1
ENTRYPOINT ["mnemosyne"]