forked from StellarRouter/StellarRouter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (19 loc) · 734 Bytes
/
Copy pathDockerfile
File metadata and controls
30 lines (19 loc) · 734 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
# syntax=docker/dockerfile:1
FROM rust:1.78-slim AS builder
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
COPY api-server/ api-server/
RUN cargo build --release -p router-api-server
FROM debian:bookworm-slim
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/router-api-server /usr/local/bin/
# Create non-root user
RUN useradd -m -u 1000 apiserver && \
chown -R apiserver:apiserver /usr/local/bin/router-api-server
USER apiserver
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
ENTRYPOINT ["router-api-server"]