-
Notifications
You must be signed in to change notification settings - Fork 33
/
Dockerfile.prod
48 lines (38 loc) · 1.69 KB
/
Dockerfile.prod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM golang:1.13-alpine as build-env
RUN apk add --update --upgrade build-base
WORKDIR /go/src
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" framework/cmd/server/server.go
FROM alpine
ENV PATH="$PATH:/bin/bash" \
BENTO4_BIN="/opt/bento4/bin" \
PATH="$PATH:/opt/bento4/bin"
# FFMPEG
RUN apk add --update ffmpeg bash curl
# Install Bento
WORKDIR /tmp/bento4
ENV BENTO4_BASE_URL="http://zebulon.bok.net/Bento4/source/" \
BENTO4_VERSION="1-5-0-615" \
BENTO4_CHECKSUM="5378dbb374343bc274981d6e2ef93bce0851bda1" \
BENTO4_TARGET="" \
BENTO4_PATH="/opt/bento4" \
BENTO4_TYPE="SRC"
# download and unzip bento4
RUN apk add --update --upgrade curl python unzip bash gcc g++ scons && \
curl -O -s ${BENTO4_BASE_URL}/Bento4-${BENTO4_TYPE}-${BENTO4_VERSION}${BENTO4_TARGET}.zip && \
sha1sum -b Bento4-${BENTO4_TYPE}-${BENTO4_VERSION}${BENTO4_TARGET}.zip | grep -o "^$BENTO4_CHECKSUM " && \
mkdir -p ${BENTO4_PATH} && \
unzip Bento4-${BENTO4_TYPE}-${BENTO4_VERSION}${BENTO4_TARGET}.zip -d ${BENTO4_PATH} && \
rm -rf Bento4-${BENTO4_TYPE}-${BENTO4_VERSION}${BENTO4_TARGET}.zip && \
apk del unzip && \
# don't do these steps if using binary install
cd ${BENTO4_PATH} && scons -u build_config=Release target=x86_64-unknown-linux && \
cp -R ${BENTO4_PATH}/Build/Targets/x86_64-unknown-linux/Release ${BENTO4_PATH}/bin && \
cp -R ${BENTO4_PATH}/Source/Python/utils ${BENTO4_PATH}/utils && \
cp -a ${BENTO4_PATH}/Source/Python/wrappers/. ${BENTO4_PATH}/bin
WORKDIR /app
COPY --from=build-env /go/src/.env /app
COPY --from=build-env /go/src/bucket-credential.json /app
COPY --from=build-env /go/src/server .
RUN ls -lah
ENTRYPOINT [ "./server" ]