-
-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from trulykyle/v4
docker support
- Loading branch information
Showing
2 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,34 @@ | ||
#源镜像 | ||
# Compile Stage | ||
FROM golang:1.22.2-alpine3.19 AS builder | ||
MAINTAINER monibuca <[email protected]> | ||
|
||
LABEL stage=gobuilder | ||
|
||
# Env | ||
ENV CGO_ENABLE 0 | ||
ENV GOOS linux | ||
ENV GOARCH amd64 | ||
ENV GOPROXY https://goproxy.cn,direct | ||
ENV HOME /monibuca | ||
|
||
COPY . /monibuca | ||
WORKDIR /monibuca | ||
|
||
# compile | ||
RUN go mod download | ||
RUN go build -ldflags="-s -w" -o /monibuca/build/monibuca ./main.go | ||
|
||
RUN cp -r /monibuca/config.yaml /monibuca/build | ||
RUN cp -r /monibuca/favicon.ico /monibuca/build | ||
|
||
# Running Stage | ||
FROM alpine:latest | ||
|
||
WORKDIR /opt | ||
WORKDIR /monibuca | ||
COPY --from=builder /monibuca/build /monibuca/ | ||
|
||
ADD monibuca_linux /opt | ||
ADD favicon.ico /opt | ||
ADD config.yaml /opt | ||
# RUN apk --no-cache add ffmpeg | ||
#暴露端口 | ||
# Export necessary ports | ||
EXPOSE 8080 8443 1935 554 58200-59200 5060 8000-9000 | ||
EXPOSE 5060/udp 58200-59200/udp 8000-9000/udp | ||
|
||
#最终运行docker的命令 | ||
ENTRYPOINT ["./monibuca_linux"] | ||
CMD [ "./monibuca" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
services: | ||
monibuca: | ||
build: | ||
dockerfile: ./Dockerfile | ||
image: monibuca:v4 | ||
restart: unless-stopped | ||
#please use host mode as expose large number of ports will cause docker extremely slow | ||
network_mode: host | ||
volumes: | ||
- ${PWD}/config.yaml:/monibuca/config.yaml |