-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.coordinator
More file actions
87 lines (69 loc) · 2.31 KB
/
Copy pathDockerfile.coordinator
File metadata and controls
87 lines (69 loc) · 2.31 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# syntax=docker/dockerfile:1.7
# Dockerfile for ARCXA Coordinator
# Multi-stage build for optimal image size
# Stage 1: Build
FROM rust:1.91.1-slim as builder
ARG ENABLE_ODBC=true
ARG CARGO_PROFILE=release
# Install build dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
libcurl4-openssl-dev \
protobuf-compiler \
cmake \
clang \
make \
&& if [ "$ENABLE_ODBC" = "true" ]; then \
apt-get install -y unixodbc-dev; \
fi \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
# Copy workspace files (proto files needed for graphica_core build.rs)
COPY Cargo.toml ./Cargo.toml
COPY Cargo.lock ./Cargo.lock
COPY proto ./proto
COPY arcxa-core ./arcxa-core
COPY arcxa-coordinator ./arcxa-coordinator
COPY arcxa-migrations ./arcxa-migrations
COPY arcxa-model-service ./arcxa-model-service
COPY arcxa-cli ./arcxa-cli
# Build coordinator (release mode)
WORKDIR /build/arcxa-coordinator
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/build/target \
if [ "$ENABLE_ODBC" = "true" ]; then \
cargo build --profile "${CARGO_PROFILE}" --bin arcxa-coordinator --features odbc; \
else \
cargo build --profile "${CARGO_PROFILE}" --bin arcxa-coordinator; \
fi \
&& cp "/build/target/${CARGO_PROFILE}/arcxa-coordinator" /tmp/arcxa-coordinator
# Stage 2: Runtime
FROM debian:trixie-slim
ARG ENABLE_ODBC=true
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
libssl3 \
ca-certificates \
curl \
&& if [ "$ENABLE_ODBC" = "true" ]; then \
apt-get install -y unixodbc libaio1; \
fi \
&& rm -rf /var/lib/apt/lists/*
# Create app directory and user
RUN useradd -m -u 1000 graphica && \
mkdir -p /app/data && \
chown -R graphica:graphica /app
WORKDIR /app
# Copy binary from builder
COPY --from=builder /tmp/arcxa-coordinator /app/arcxa-coordinator
# Reserve a config directory for local/demo mounts without relying on optional COPY patterns.
RUN mkdir -p /app/config && chown -R graphica:graphica /app/config
USER graphica
# Expose ports
EXPOSE 8080 9090 9091
# Health check
HEALTHCHECK --interval=10s --timeout=5s --start-period=30s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
# Run coordinator
ENTRYPOINT ["/app/arcxa-coordinator"]