From b7f6263703e2ff76883a703d4664258d18263c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Einarson?= Date: Sun, 29 Oct 2023 17:36:27 +0100 Subject: [PATCH] feat: simple Dockerfile to build a small livesim2 image including sample test content --- CHANGELOG.md | 3 ++- Dockerfile | 21 +++++++++++++++++++++ README.md | 7 +++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/CHANGELOG.md b/CHANGELOG.md index a32e407..bee99d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Added -- New highly configurable `statuscode`` parameter for cyclic bad segment request responses +- New highly configurable `statuscode` parameter for cyclic bad segment request responses - New URL parameter `traffic` to simulate periodic issues with fetching segments. Supports multiple parallel BaseURLs. +- Dockerfile to build a minimal Docker image with sample test content ## Changed diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..45ffd02 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# Two-stage Docker-file to build a small livesim2 image +# The test content content is copied to /vod and will be used +# To enable HTTPS with fixed certificate + key, +# add files and speficy options to read them + +# Build as "docker build -t livesim2 ." +# Run as "docker run -p 8888:8888 livesim2" + +# Build Stage +FROM golang:1.21.3-alpine3.18 AS BuildStage +WORKDIR /work +COPY . . +RUN go mod download +RUN go build -o ./out/livesim2 ./cmd/livesim2/main.go +# Deploy Stage +FROM alpine:latest +WORKDIR / +COPY --from=BuildStage /work/out/ / +COPY --from=BuildStage /work/cmd/livesim2/app/testdata/assets /vod +EXPOSE 8888 +ENTRYPOINT ["/livesim2", "--logformat", "json"] \ No newline at end of file diff --git a/README.md b/README.md index e635470..bb058e7 100644 --- a/README.md +++ b/README.md @@ -309,6 +309,13 @@ More information can be found in the [deployment/README.md](deployment/README.md To get information about the available assets and other information access the server's root URL. +### Docker + +A simple `Dockerfile` is also provided. It builds a stand-alone livesim2 +image bundled with the test content that is provided in this repo. +Some comments are included in the Dockerfile. Check the options of livesim2 +to find out how to add other content, HTTPs etc. + ## List of functionality and options The URL parameters are now listed on this project's Wiki page