-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (45 loc) · 1.27 KB
/
Dockerfile
File metadata and controls
58 lines (45 loc) · 1.27 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
# Multi-stage build for Replicante
FROM rust:1.88-alpine AS builder
# Install build dependencies
RUN apk add --no-cache \
musl-dev \
pkgconfig \
openssl-dev \
sqlite-dev \
sqlite-static
# Create app directory
WORKDIR /app
# Copy source code
COPY Cargo.toml Cargo.lock ./
COPY src ./src
# Build the application
RUN cargo build --release --target x86_64-unknown-linux-musl
# Runtime stage
FROM alpine:3.19
# Install runtime dependencies
RUN apk add --no-cache \
ca-certificates \
sqlite-libs \
curl \
nodejs \
npm
# Create non-root user
RUN addgroup -g 1000 replicante && \
adduser -D -u 1000 -G replicante replicante
# Copy binary from builder
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/replicante /usr/local/bin/replicante
# Create necessary directories
RUN mkdir -p /data /sandbox /config /logs && \
chown -R replicante:replicante /data /sandbox /logs
# Switch to non-root user
USER replicante
WORKDIR /home/replicante
# Default environment variables
ENV RUST_LOG=info
ENV DATABASE_PATH=/data/replicante.db
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD ["echo", "healthy"]
# Default command (can be overridden)
ENTRYPOINT ["/usr/local/bin/replicante"]
CMD ["agent"]