-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 906 Bytes
/
Dockerfile
File metadata and controls
37 lines (26 loc) · 906 Bytes
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
# Multi-stage build for excalirender
# Stage 1: Build the binary with all native dependencies
FROM oven/bun:alpine AS builder
# Install canvas native dependencies (python3/make/g++/pkgconfig needed for node-canvas compilation on musl)
RUN apk add --no-cache \
python3 make g++ pkgconfig \
cairo-dev pango-dev libjpeg-turbo-dev giflib-dev librsvg-dev
WORKDIR /app
# Copy package files first for better caching
COPY package.json bun.lock* ./
# Install dependencies
RUN bun install
# Copy source code
COPY . .
# Build the binary
RUN bun run build
# Stage 2: Runtime image with native libraries
FROM alpine:3.20
# Install runtime dependencies for canvas
RUN apk add --no-cache \
cairo pango libjpeg-turbo giflib librsvg pixman
# Copy the compiled binary
COPY --from=builder /app/excalirender /excalirender
# Make binary executable
RUN chmod +x /excalirender
ENTRYPOINT ["/excalirender"]