From a560b977664caefe868e81ddb0e98fcd2239b958 Mon Sep 17 00:00:00 2001 From: Fumon Shimadate <141066392+fumons@users.noreply.github.com> Date: Sun, 26 Oct 2025 20:14:21 +0900 Subject: [PATCH] Document Docker Compose usage --- README.md | 22 ++++++++++++++++++++++ docker-compose.yml | 21 +++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 docker-compose.yml diff --git a/README.md b/README.md index a2d2ef3..400c48a 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,28 @@ $ msak-server 2024/01/04 17:41:01 INFO Accepting UDP packets... ``` +## Docker Compose + +To run the published container image with Docker Compose, install +[Docker Compose V2](https://docs.docker.com/compose/install/) and then start the +service from this repository root: + +```sh +$ docker compose up -d +``` + +The compose file starts `ghcr.io/fumons/msak-server:latest`, publishes the +throughput (`8080/tcp`), metrics (`9990/tcp`), and latency (`1053/udp`) ports, +and stores persistent state in the `msak-data` Docker volume. The server exposes +Prometheus-formatted metrics at `http://localhost:9990/metrics` and will be +restarted automatically if the container stops. + +To stop the service and remove the container while keeping the data volume: + +```sh +$ docker compose down +``` + ## Clients To build the client and target the local server: diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9d59578 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: "3.9" + +services: + msak-server: + image: ghcr.io/fumons/msak-server:latest + ports: + - "8080:8080" + - "9990:9990" + - "1053:1053/udp" + volumes: + - msak-data:/msak/data + restart: unless-stopped + healthcheck: + test: ["CMD", "wget", "-qO", "-", "http://localhost:9990/metrics"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 10s + +volumes: + msak-data: