-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (44 loc) · 1.46 KB
/
Dockerfile
File metadata and controls
55 lines (44 loc) · 1.46 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
51
52
53
54
55
# Multi-stage Dockerfile for building exograph exo-server
ARG RUST_VERSION=1.92
FROM rust:${RUST_VERSION}-slim AS builder
# Install build dependencies
RUN apt-get update && apt-get install -y \
protobuf-compiler \
pkg-config \
libssl-dev \
git \
curl \
clang \
libclang-dev \
libsqlite3-dev \
libffi-dev \
build-essential \
ca-certificates \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
# Copy source files
COPY Cargo.toml Cargo.lock ./
COPY crates ./crates
COPY libs ./libs
COPY playground ./playground
# Install npm dependencies
RUN if [ -f crates/introspection-util/package.json ]; then cd crates/introspection-util && npm ci; fi
RUN if [ -f playground/lib/package.json ]; then cd playground/lib && npm ci; fi
# Ensure npm is in PATH for build scripts
ENV PATH="/usr/bin:${PATH}"
# Build both exo CLI and exo-server
RUN cargo build --release --bin exo --bin exo-server
# Runtime stage (use sid to match glibc version from rust:<version>-slim)
FROM debian:sid-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
# Copy the built binaries
COPY --from=builder /build/target/release/exo /usr/local/bin/exo
COPY --from=builder /build/target/release/exo-server /usr/local/bin/exo-server
# Set the entrypoint
ENTRYPOINT ["exo-server"]