Browse Source

Dockerfile

pull/86/head
Ruben Cid 5 years ago
parent
commit
9f0f3b1c03
  1. 7
      Dockerfile
  2. 5
      README.md
  3. 0
      config/livego.json
  4. 2
      main.go

7
Dockerfile

@ -3,17 +3,20 @@ WORKDIR /app @@ -3,17 +3,20 @@ WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o livego ./
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o livego .
FROM alpine:latest
LABEL maintainer="Ruben Cid Lara <rubencidlara@gmail.com>"
RUN mkdir -p /app/config
WORKDIR /app
ENV RTMP_PORT 1935
ENV HTTP_FLV_PORT 7001
ENV HLS_PORT 7002
ENV HTTP_OPERATION_PORT 8090
COPY --from=builder /app/config ./config
COPY --from=builder /app/livego .
EXPOSE ${RTMP_PORT}
EXPOSE ${HTTP_FLV_PORT}
EXPOSE ${HLS_PORT}
EXPOSE ${HTTP_OPERATION_PORT}
CMD ./livego
ENTRYPOINT ["./livego"]

5
README.md

@ -23,10 +23,10 @@ Simple and efficient live broadcast server: @@ -23,10 +23,10 @@ Simple and efficient live broadcast server:
After directly downloading the compiled [binary file](https://github.com/gwuhaolin/livego/releases), execute it on the command line.
#### Boot from Docker
Run `docker run -p 1935: 1935 -p 7001: 7001 -p 7002: 7002 -d --name livego gwuhaolin / livego` to start
Run `docker run -p 1935:1935 -p 7001:7001 -p 7002:7002 -d --name livego gwuhaolin/livego` to start
#### Compile from source
1. Download the source code `git clone https: // github.com / gwuhaolin / livego.git`
1. Download the source code `git clone https://github.com/gwuhaolin/livego.git`
2. Go to the livego directory and execute `go build`
## Use
@ -37,7 +37,6 @@ Run `docker run -p 1935: 1935 -p 7001: 7001 -p 7002: 7002 -d --name livego gwuha @@ -37,7 +37,6 @@ Run `docker run -p 1935: 1935 -p 7001: 7001 -p 7002: 7002 -d --name livego gwuha
-`FLV`:`http://127.0.0.1:7001/live/movie.flv`
-`HLS`:`http://127.0.0.1:7002/live/movie.m3u8`
### [Use with flv.js](https://github.com/gwuhaolin/blog/issues/3)
Interested in Golang? Please see [Golang Chinese Learning Materials Summary](http://go.wuhaolin.cn/)

0
.livego.json → config/livego.json

2
main.go

@ -19,7 +19,7 @@ var ( @@ -19,7 +19,7 @@ var (
httpFlvAddr = flag.String("httpflv-addr", ":7001", "HTTP-FLV server listen address")
hlsAddr = flag.String("hls-addr", ":7002", "HLS server listen address")
operaAddr = flag.String("manage-addr", ":8090", "HTTP manage interface server listen address")
configfilename = flag.String("cfgfile", ".livego.json", "configure filename")
configfilename = flag.String("config-file", "config/livego.json", "configure filename")
)
func init() {

Loading…
Cancel
Save