-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
54 lines (39 loc) · 1.22 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
# CUDA 11.4 matches the runtime at the latest AWS ECS-optimized AMI for GPU instances
# https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html
# Use the development version to be able to reference headers during FFmpeg build
FROM nvidia/cuda:11.4.0-devel-ubuntu20.04
ARG DEBIAN_FRONTEND=noninteractive
# Mount all driver libraries
# https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/user-guide.html#driver-capabilities
ENV NVIDIA_DRIVER_CAPABILITIES=all
ENV PORT=3000
ENV NODE_ENV=develop
RUN apt-get update -y && apt-get install -y curl wget
RUN mkdir /install
WORKDIR /install
# FFmpeg, build from source and include NVIDIA codecs
COPY ./install/ffmpeg.sh .
RUN bash -e ffmpeg.sh
# VirtualGL
COPY ./install/virtualgl.sh .
RUN bash -e virtualgl.sh
# Chrome dependencies
COPY ./install/chrome.sh .
RUN bash -e chrome.sh
# Utilities
COPY ./install/utils.sh .
RUN bash -e utils.sh
# Node.js
COPY ./install/node.sh .
RUN bash -e node.sh
RUN rm -rf /install
# Application
WORKDIR /usr/src/app
COPY package.json .
COPY package-lock.json .
RUN npm i
ADD . .
RUN npm run build && rm -rf src
# RUN rm -rf node_modules && npm ci
RUN chmod -R o+rwx node_modules/puppeteer/.local-chromium
CMD npm start