Skip to content

Commit daab2ae

Browse files
committed
Dockerfile for standalone echokit-server container
1 parent 490e3cd commit daab2ae

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

docker/server/Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# syntax=docker/dockerfile:1.6
2+
3+
FROM rust:1.85-slim AS builder
4+
5+
WORKDIR /app
6+
7+
# Install build dependencies required by reqwest/rustls toolchain.
8+
RUN apt-get update \
9+
&& apt-get install -y --no-install-recommends pkg-config libssl-dev build-essential git \
10+
&& rm -rf /var/lib/apt/lists/*
11+
12+
RUN git clone https://github.com/second-state/echokit_server.git
13+
RUN cd echokit_server \
14+
&& cargo build --release
15+
16+
17+
FROM debian:bookworm-slim AS runtime
18+
19+
RUN apt-get update \
20+
&& apt-get install -y --no-install-recommends ca-certificates libssl3 \
21+
&& rm -rf /var/lib/apt/lists/*
22+
23+
WORKDIR /app
24+
25+
COPY --from=builder /app/echokit_server/config.toml .
26+
COPY --from=builder /app/echokit_server/target/release/echokit_server /usr/local/bin/echokit_server
27+
28+
ENV RUST_LOG=info
29+
30+
CMD ["echokit_server", "config.toml"]

docker/server/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# echokit-server Standalone Docker Image
2+
3+
This directory contains a multi-stage Dockerfile for producing a lean runtime image of `echokit_server`.
4+
5+
- **Builder stage** (`rust:1.85-slim`): installs the minimal Rust toolchain dependencies, clones `https://github.com/second-state/echokit_server`, and compiles the project in release mode.
6+
- **Runtime stage** (`debian:bookworm-slim`): installs the required runtime libraries, copies the compiled binary and default `config.toml`, and sets `RUST_LOG=info` before starting the server with that config.
7+
8+
## Build
9+
10+
```sh
11+
docker build -t echokit:latest-server .
12+
```
13+
14+
## Run
15+
16+
Mount your local `config.toml` so the container uses your configuration:
17+
18+
```sh
19+
docker run --rm -v $(pwd)/config.toml:/app/config.toml echokit:latest-server
20+
```
21+
22+
The container executes `echokit_server config.toml` by default, reading logs at the `info` level.

0 commit comments

Comments
 (0)