-
Notifications
You must be signed in to change notification settings - Fork 54
/
Dockerfile.gl
56 lines (40 loc) · 1.65 KB
/
Dockerfile.gl
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
# Build stage
FROM nvidia/opengl:1.0-glvnd-devel-ubuntu20.04 as builder
# Install node 14.0
RUN apt-get update -y && \
apt-get install -y curl gnupg ca-certificates && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs
# See: https://github.com/stackgl/headless-gl#ubuntudebian
RUN apt-get update -y && \
apt-get install -y build-essential python libxi-dev libglu-dev libglew-dev pkg-config git
WORKDIR /build
COPY . .
RUN npm install yarn --global
RUN yarn install
RUN yarn deploy:web
# Build headless-gl natively as the prebuilt binary is not compatible
# See https://github.com/stackgl/headless-gl/issues/65#issuecomment-252742795
RUN git clone https://github.com/stackgl/headless-gl.git && \
cd headless-gl && \
git submodule init && \
git submodule update && \
npm install && \
npm run rebuild
# We will later copy headless-gl/build/Release/webgl.node into runtime layer
# Runtime stage, install and copy only what's needed to run
FROM nvidia/opengl:1.0-glvnd-devel-ubuntu20.04
# Install node 14.0
RUN apt-get update -y && \
apt-get install -y curl gnupg ca-certificates && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs
# See: https://github.com/stackgl/headless-gl#ubuntudebian
RUN apt-get update -y && \
apt-get install -y build-essential python libxi-dev libglu-dev libglew-dev pkg-config git
WORKDIR /app
COPY --from=builder /build .
COPY --from=builder /build/headless-gl/build/Release/webgl.node node_modules/gl/build/Release/webgl.node
RUN npm install yarn --global
ENV DISPLAY :0
RUN yarn workspace phoenix-event-display test