generated from garasingulik/typescript-express-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
46 lines (30 loc) · 1.13 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
# build environment
FROM node:12.20.0-buster as build
WORKDIR /app
ARG FFMPEG_VERSION=4.3.1
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
RUN curl -o - -L https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-${FFMPEG_VERSION}-amd64-static.tar.xz | tar -Jxf - -C /usr/bin --strip-components 1 ffmpeg-${FFMPEG_VERSION}-amd64-static/ffmpeg ffmpeg-${FFMPEG_VERSION}-amd64-static/ffprobe && chmod +x /usr/bin/ffmpeg && chmod +x /usr/bin/ffprobe
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
COPY package-lock.json ./
RUN npm install
COPY . ./
RUN npm run build
# production environment
FROM node:12.20.0-buster-slim
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
ENV NODE_ENV production
COPY package.json ./
COPY package-lock.json ./
RUN npm install --production
COPY ./public ./public
COPY --from=build /app/build ./build
COPY --from=build /usr/bin/ffmpeg /usr/bin/ffmpeg
COPY --from=build /usr/bin/ffprobe /usr/bin/ffprobe
RUN chmod +x /usr/bin/ffmpeg && chmod +x /usr/bin/ffprobe
VOLUME [ "/app/public" ]
ENV API_SECRET='' \
STREAM_API_URL=''
EXPOSE 80
CMD ["node", "/app/build/src/server.js"]