forked from j62/ctbrec
1
0
Fork 0

DockerFile to build the server

The following commande help build the server with the required version :
docker build --build-arg versionM3u8=0.2.7-CTBREC --build-arg version=1.16.0  --build-arg memory=-Xmx192m  -t bounty1342/ctbrec . --no-cache

Next update could select the branch or commit to ease testing.
This commit is contained in:
bounty1342 2019-01-01 22:32:59 +01:00 committed by GitHub
parent 6155f424de
commit da4b0ec20c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 33 additions and 0 deletions

33
server/Dockerfile.txt Normal file
View File

@ -0,0 +1,33 @@
FROM alpine/git as open-m3u8Git
WORKDIR /app
RUN git clone https://github.com/0xboobface/open-m3u8.git
FROM gradle:4.10-jdk10 as open-m3u8Build
WORKDIR /app/open-m3u8
COPY --from=open-m3u8Git --chown=gradle:gradle /app /app
RUN gradle install
FROM alpine/git as ctbrecGit
WORKDIR /app
RUN git clone https://github.com/0xboobface/ctbrec.git
FROM maven:3-jdk-11-slim as ctbrecBuild
ARG ctbrec
ARG versionM3u8
WORKDIR /app/master
COPY --from=ctbrecGit /app/ctbrec /app
COPY --from=open-m3u8Build /app/open-m3u8/build/libs/ /app/common/libs/
RUN mvn clean install:install-file -Dfile=/app/common/libs/open-m3u8-${versionM3u8}.jar -DgroupId=com.iheartradio.m3u8 -DartifactId=open-m3u8 -Dversion=${versionM3u8} -Dpackaging=jar -DgeneratePom=true
RUN mvn clean
RUN mvn install
FROM openjdk:12-alpine
WORKDIR /app
ARG memory
ARG version
ENV artifact ctbrec-server-${version}-final.jar
ENV path /app/server/target/${artifact}
COPY --from=ctbrecBuild ${path} ./${artifact}
EXPOSE 8080
CMD java ${memory} -cp ${artifact} -Dctbrec.config=/server.json ctbrec.recorder.server.HttpServer