Dockerfile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. FROM ossrs/srs:dev AS build
  2. # Install depends tools.
  3. RUN yum install -y gcc make gcc-c++ patch unzip perl git
  4. ARG SRS_AUTO_PACKAGER
  5. # Build and install SRS.
  6. COPY . /srs
  7. WORKDIR /srs/trunk
  8. RUN ./configure --srt=on --jobs=2 && make -j2 && make install
  9. # All config files for SRS.
  10. RUN cp -R conf /usr/local/srs/conf && \
  11. cp research/api-server/static-dir/index.html /usr/local/srs/objs/nginx/html/ && \
  12. cp research/api-server/static-dir/favicon.ico /usr/local/srs/objs/nginx/html/ && \
  13. cp research/players/crossdomain.xml /usr/local/srs/objs/nginx/html/ && \
  14. cp -R research/console /usr/local/srs/objs/nginx/html/ && \
  15. cp -R research/players /usr/local/srs/objs/nginx/html/ && \
  16. cp -R 3rdparty/signaling/www/demos /usr/local/srs/objs/nginx/html/
  17. ############################################################
  18. # dist
  19. ############################################################
  20. FROM centos:7 AS dist
  21. # Expose ports for streaming @see https://github.com/ossrs/srs#ports
  22. EXPOSE 1935 1985 8080 8000/udp 10080/udp
  23. # FFMPEG 4.1
  24. COPY --from=build /usr/local/bin/ffmpeg /usr/local/srs/objs/ffmpeg/bin/ffmpeg
  25. # SRS binary, config files and srs-console.
  26. COPY --from=build /usr/local/srs /usr/local/srs
  27. # Default workdir and command.
  28. WORKDIR /usr/local/srs
  29. CMD ["./objs/srs", "-c", "conf/docker.conf"]