mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-19 17:44:50 +00:00
Since Pion's webrtc v3.0.13 and this fix if both peers have some fmtp set then codecs should match exactly. By default Pion defines a list of supported codecs with fmtp set but different browsers set their own fmtp values by default as well therefore they may not match.
To fix this we can define our own list of codecs on the server with empty fmtp so it will match any client codecs.
See: e5c8c659ca/rtpcodec.go (L99)
50 lines
973 B
Docker
Vendored
50 lines
973 B
Docker
Vendored
# The base cloud-game image
|
|
ARG BUILD_PATH=/go/src/github.com/giongto35/cloud-game
|
|
|
|
# build image
|
|
FROM golang:1.16 AS build
|
|
ARG BUILD_PATH
|
|
WORKDIR ${BUILD_PATH}
|
|
|
|
# system libs layer
|
|
RUN apt-get update && apt-get install -y \
|
|
make \
|
|
pkg-config \
|
|
libvpx-dev \
|
|
libx264-dev \
|
|
libopus-dev \
|
|
libopusfile-dev \
|
|
libsdl2-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# go deps layer
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
# app build layer
|
|
COPY ./ ./
|
|
RUN make build
|
|
|
|
# base image
|
|
FROM debian:10-slim
|
|
ARG BUILD_PATH
|
|
WORKDIR /usr/local/share/cloud-game
|
|
|
|
RUN apt-get update && apt-get install --no-install-recommends -y \
|
|
ca-certificates \
|
|
libvpx5 \
|
|
libx264-155 \
|
|
libopus0 \
|
|
libopusfile0 \
|
|
libsdl2-2.0-0 \
|
|
libgl1-mesa-glx \
|
|
xvfb \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=build ${BUILD_PATH}/bin/ ./
|
|
RUN cp -s $(pwd)/* /usr/local/bin
|
|
COPY assets/cores ./assets/cores
|
|
COPY configs ./configs
|
|
COPY web ./web
|
|
|
|
EXPOSE 8000 9000
|