Skip to content

Commit

Permalink
Merge pull request #132 from Dash-Industry-Forum/docker-multi-stage
Browse files Browse the repository at this point in the history
 Dockerfile to build a small livesim2 image including sample test content
  • Loading branch information
tobbee authored Oct 29, 2023
2 parents 9bf47d4 + b7f6263 commit 5e04977
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e04977

Please sign in to comment.