-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
26 lines (26 loc) · 1.11 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
FROM node:18
RUN apt-get -y update
RUN apt-get -y install --fix-missing xvfb
RUN apt-get -y install libnss3 libatk1.0-0 libatk-bridge2.0-0 libgtk-3-0 libgbm-dev libasound2
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
ENV XDG_RUNTIME_DIR=/run/user/0
ENV DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/bus
RUN mkdir $XDG_RUNTIME_DIR && chmod 700 $XDG_RUNTIME_DIR && chown root:root $XDG_RUNTIME_DIR
WORKDIR /src
COPY <<-EOT /src/build.sh
# commands before `xvfb-run -a npm run test` avoid these ERROR messages:
# - Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
# - Exiting GPU process due to errors during initialization
service dbus start
dbus-daemon --session --address=$DBUS_SESSION_BUS_ADDRESS --nofork --nopidfile --syslog-only &
mkdir ~/.vscode && echo '{ "disable-hardware-acceleration": true }' > ~/.vscode/argv.json
# Build and Test
npm ci
npm install -g wasm-pack
npm run wasm-build
xvfb-run -a npm run test
npm run package
EOT
RUN chmod +x build.sh
COPY . /src/