Add Dockerfile for containeraization

This commit is contained in:
Gabe Kangas 2020-06-09 18:28:07 -07:00
parent a9e1f1e82e
commit bd145fddf0
3 changed files with 19 additions and 1 deletions

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM golang:alpine
EXPOSE 8080 1935
RUN mkdir /app
ADD . /app
WORKDIR /app
RUN apk add --no-cache ffmpeg ffmpeg-libs
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o owncast .
RUN ls -al owncast
WORKDIR /app
CMD ["/app/owncast"]

View File

@ -27,6 +27,7 @@
* [Prerequisites](#prerequisites)
* [Installation](#installation)
* [Usage](#usage)
* [Docker](#docker)
* [Usage with OBS](#usage-with-obs)
* [Video storage and distribution options](#video-storage-options)
* [Advanced usage](#advanced-usage)
@ -84,6 +85,13 @@ The goal is to have a single service that you can run and it works out of the bo
1. Open your web browser and visit http://yourserver:8080/. If you changed the port in the config file, then change the URL accordingly. If you are testing this on your own personal computer then you can visit http://localhost:8080.
### Docker
If you want a simpler way to run an instance of owncast you can run it in a container with the supplied Dockerfile.
1. Run `docker build -t owncast .`
1. Run `docker run -p 8080:8080 -p 1935:1935 -it owncast`
## Usage with OBS
1. Install [OBS](https://obsproject.com/) and get it working with your local setup.

View File

@ -73,7 +73,7 @@ func startFfmpeg(configuration Config) {
// fmt.Println(ffmpegCmd)
_, err := exec.Command("bash", "-c", ffmpegCmd).Output()
_, err := exec.Command("sh", "-c", ffmpegCmd).Output()
fmt.Println(err)
verifyError(err)
}