-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile.cuda
67 lines (47 loc) · 1.71 KB
/
Dockerfile.cuda
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
FROM nvidia/cuda:11.4.2-base-ubuntu20.04 as deps
WORKDIR /app
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_17.x | bash - && \
apt update && \
apt install -y nodejs python3 g++ make
COPY package.json .
COPY package-lock.json .
RUN npm i \
&& mv ./node_modules/@types/jsonstream ./node_modules/@types/JSONStream
FROM deps as frontend
WORKDIR /app
COPY public ./public
COPY src ./src
COPY plugins ./plugins
COPY types ./types
COPY Shared ./Shared
COPY .browserslistrc tsconfig.json tslint.json vue.config.js ./
COPY .eslintrc.js ./
RUN npm run build-frontend
FROM deps as backend
WORKDIR /app
COPY backend ./backend
COPY Shared ./Shared
RUN npm run build-backend
FROM nvidia/cuda:11.4.2-base-ubuntu20.04
WORKDIR /app
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_17.x | bash - && \
apt update && \
apt install -y nodejs git
RUN curl -L -o ffmpeg-master-latest-linux64-lgpl.tar.xz "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-lgpl.tar.xz" && \
tar xf ffmpeg-master-latest-linux64-lgpl.tar.xz && \
mv ffmpeg-master-latest-linux64-lgpl ffmpeg
ENV PATH "$PATH:/app/ffmpeg/bin"
COPY --from=deps /app/node_modules node_modules
COPY --from=deps /app/package.json .
COPY --from=frontend /app/client client
COPY --from=backend /app/backend/build .
COPY --from=backend /app/backend/tsconfig.json ./backend
COPY .git ./.git
RUN echo "window.build=\"$(git rev-parse HEAD | cut -c 1-7)_$(date +'%d.%m.%Y')_$(date +"%T")\";" > /app/client/env.js \
&& rm -rf .git
EXPOSE 80 443
ENTRYPOINT [ "npm", "start" ]