-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (39 loc) · 1.4 KB
/
Dockerfile
File metadata and controls
47 lines (39 loc) · 1.4 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
FROM clux/muslrust:stable AS builder
WORKDIR /app
COPY Cargo.toml Cargo.lock* ./
COPY src src
COPY templates templates
COPY static static
COPY config.json config.json
# Build a statically linked binary to avoid runtime glibc mismatches.
RUN rustup target add x86_64-unknown-linux-musl && \
cargo build --release --target x86_64-unknown-linux-musl
FROM gcr.io/distroless/cc
WORKDIR /app
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/status /usr/local/bin/status
COPY templates templates
COPY static static
COPY config.json config.json
ENV RUST_LOG=info
# Polling configuration (used in daemon mode)
ENV POLL_TIMEOUT_SECS=30
ENV POLL_BACKOFF_SECS=5
ENV POLL_MAX_BACKOFF_SECS=60
ENV DASHBOARD_URL=""
ENV DEPLOYMENT_HASH=""
# Expose API/UI port
EXPOSE 5000
# MODE options:
# "serve-ui" - API server with web UI (default)
# "serve" - API server without UI
# "daemon" - Background polling agent
# "both" - API server + polling loop
ENV MODE="serve-ui"
# Use shell form to allow ENV variable expansion
# Note: distroless/cc doesn't have shell, so we use a wrapper script approach
# For simple cases, override CMD at runtime:
# docker run ... status serve --port 5000 --with-ui
# docker run ... status (daemon mode with polling)
# CMD ["/usr/local/bin/status", "serve", "--port", "5000", "--with-ui"]
ENTRYPOINT ["/usr/local/bin/status"]
CMD ["serve", "--port", "5000", "--with-ui"]