-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
121 lines (111 loc) · 2.63 KB
/
Dockerfile
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
FROM node:18-alpine
# ffmpeg build script taken from https://github.com/denismakogon/ffmpeg-alpine/blob/master/custom/alpine/Dockerfile
# TODO: break this into staged builds so we don't pollute the service container with build tools
ENV FFMPEG_VERSION=6.0
ENV FFMPEG_CORE="bash \
tzdata \
libass \
libstdc++ \
libpng \
libjpeg \
xvidcore \
x264-libs \
x265 \
libvpx \
libvorbis \
opus \
lame \
fdk-aac \
freetype \
libcrypto1.1 \
libssl1.1 \
jasper \
libavc1394 \
yasm"
ENV RUNTIME_DEPS="coreutils \
make \
cmake \
gcc \
g++ \
clang \
linux-headers \
git \
curl"
ENV BUILD_DEPS="fdk-aac-dev \
freetype-dev \
x264-dev \
x265-dev \
yasm-dev \
libogg-dev \
libvorbis-dev \
opus-dev \
libvpx-dev \
lame-dev \
xvidcore-dev \
libass-dev \
openssl-dev \
musl-dev \
build-base \
libjpeg-turbo-dev \
libpng-dev \
jasper-dev \
libavc1394-dev \
libavc1394-dev \
clang-dev"
# FFMPEG
RUN apk update && \
apk add --no-cache apk-tools && \
echo http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
apk update && \
apk add --no-cache --virtual .runtime-deps ${RUNTIME_DEPS} && \
apk add --no-cache ${FFMPEG_CORE} && \
apk add --no-cache --virtual .build-deps ${BUILD_DEPS} && \
export SRC=/usr \
DIR=$(mktemp -d) && cd ${DIR} && \
curl -Os http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \
tar xzvf ffmpeg-${FFMPEG_VERSION}.tar.gz && \
cd ffmpeg-${FFMPEG_VERSION} && \
./configure \
--prefix="${SRC}" \
--extra-cflags="-I${SRC}/include" \
--extra-ldflags="-L${SRC}/lib" \
--bindir="${SRC}/bin" \
--extra-libs=-ldl \
--enable-version3 \
--enable-libmp3lame \
--enable-pthreads \
--enable-libx264 \
--enable-libxvid \
--enable-gpl \
--enable-postproc \
--enable-nonfree \
--enable-libfdk-aac \
--disable-debug \
--enable-small \
--enable-openssl \
--enable-libx265 \
--enable-libopus \
--enable-libvorbis \
--enable-libvpx \
--enable-libfreetype \
--enable-libass \
--enable-shared \
--enable-pic && \
make && \
make install && \
make distclean && \
hash -r && \
cd /tmp && \
rm -rf ${DIR} && \
apk del .build-deps && \
apk del .runtime-deps && \
rm -rf /var/cache/apk/*
WORKDIR /app
COPY . .
RUN npm i -g pnpm
# TODO: in staged build, compile before the
# prod build and use pnpm install --production in prod container
RUN pnpm install
RUN pnpm build
EXPOSE 4000
CMD [ "pnpm", "start" ]