-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (43 loc) · 1.35 KB
/
Copy pathDockerfile
File metadata and controls
57 lines (43 loc) · 1.35 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
# Multi-stage Dockerfile for ARDA Ingestion Service
# Stage 1: Build the Rust application
FROM rustlang/rust:nightly-bookworm AS builder
WORKDIR /app
# Install build dependencies for pdfium-render static linking
RUN apt-get update && apt-get install -y \
clang \
cmake \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Copy the entire project
COPY . .
# Build the application in release mode
RUN cargo build --release
# Stage 2: Create the runtime image
FROM debian:bookworm-slim
# Install runtime dependencies including poppler-utils for PDF processing
RUN apt-get update && \
apt-get install -y \
ca-certificates \
libssl3 \
curl \
poppler-utils \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user to run the application
RUN useradd -m -u 1000 -s /bin/bash arda && \
mkdir -p /app/logs && \
chown -R arda:arda /app
# Set working directory
WORKDIR /app
# Copy the binary from builder stage
COPY --from=builder /app/target/release/arda-ingest /app/arda-ingest
# Change ownership of the binary
RUN chown arda:arda /app/arda-ingest
# Switch to non-root user
USER arda
# Expose the default server port
EXPOSE 5678
# Add health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD curl -f http://localhost:5678/health || exit 1
# Set the binary as the entrypoint
CMD ["/app/arda-ingest"]