Skip to content

Commit 2c3bf0e

Browse files
committed
docs: add Dockerfile + Build section to README
Closes two real gaps a fresh reader hits today: - The README jumped straight to `tuyau server ...` with no path to actually get the binary. New "Build" section covers cargo build / cargo install / docker build, plus a note for embedders (axum feature on tuyau-client). - examples/docker-compose.yml referenced `tuyau:latest` with a comment pointing at `docker build -t tuyau .` — but no Dockerfile existed. Added a minimal multi-stage Dockerfile (rust:1-slim build → debian:bookworm-slim runtime, ca-certificates for rustls-acme, non-root user). The compose example now actually works. Dockerfile not smoke-tested locally (no docker daemon in this env); standard multi-stage Rust pattern, no surprises.
1 parent 20d7ce0 commit 2c3bf0e

4 files changed

Lines changed: 41 additions & 1 deletion

File tree

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target
2+
.git

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Multi-stage build for the `tuyau` binary (both `server` and `client`
2+
# subcommands live in one binary).
3+
4+
FROM rust:1-slim AS build
5+
WORKDIR /src
6+
COPY . .
7+
RUN cargo build --release --bin tuyau
8+
9+
FROM debian:bookworm-slim
10+
# ca-certificates: rustls-acme validates the ACME directory's TLS chain
11+
# against the system trust store when the `[acme]` block is enabled.
12+
RUN apt-get update \
13+
&& apt-get install -y --no-install-recommends ca-certificates \
14+
&& rm -rf /var/lib/apt/lists/*
15+
RUN useradd --system --no-create-home --shell /usr/sbin/nologin tuyau
16+
COPY --from=build /src/target/release/tuyau /usr/local/bin/tuyau
17+
USER tuyau
18+
ENTRYPOINT ["tuyau"]

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,26 @@ a local service.
4545
TLS-ALPN-01. Without it, the public listener serves a dev self-signed
4646
multi-SAN cert (`curl -k` works; browsers complain).
4747

48+
## Build
49+
50+
Requires Rust 1.85+ (edition 2024). Both `server` and `client` ship as
51+
subcommands of the same `tuyau` binary.
52+
53+
```bash
54+
cargo build --release # binary at target/release/tuyau
55+
cargo install --path crates/tuyau-cli # or put `tuyau` on PATH
56+
```
57+
58+
Container image (server + client in one):
59+
60+
```bash
61+
docker build -t tuyau .
62+
```
63+
64+
Embedding the client as a library: add `tuyau-client` as a dependency and
65+
enable the `axum` feature for the [`axum::serve`](#3-or-embed-it-in-your-axum-app)
66+
adapter.
67+
4868
## Quick start
4969

5070
### 1. Run the server

examples/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
services:
1515
tuyau-client:
16-
image: tuyau:latest # build locally for now: `docker build -t tuyau .`
16+
image: tuyau:latest # built from the repo Dockerfile: `docker build -t tuyau .`
1717
# --ingress maps each public hostname to a local service. Repeatable.
1818
# Here "app" is another service on the compose network.
1919
command: ["client", "--ingress", "alpha.example.com=app:8080"]

0 commit comments

Comments
 (0)