File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM node:14.16
2+
3+ # install electron dependencies or more if your library has other dependencies
4+ RUN apt-get update && apt-get install \
5+ git libx11-xcb1 libxcb-dri3-0 libxtst6 libnss3 libatk-bridge2.0-0 libgtk-3-0 libxss1 libasound2 \
6+ -yq --no-install-suggests --no-install-recommends \
7+ && apt-get clean && rm -rf /var/lib/apt/lists/*
8+
9+ # copy the source into /app
10+ WORKDIR /app
11+ COPY . .
12+ RUN chown -R node /app
13+
14+ # install node modules and perform an electron rebuild
15+ USER node
16+ RUN npm install
17+
18+ # Electron needs root for sand boxing
19+ # see https://github.com/electron/electron/issues/17972
20+ USER root
21+ RUN chown root /app/node_modules/electron/dist/chrome-sandbox
22+ RUN chmod 4755 /app/node_modules/electron/dist/chrome-sandbox
23+
24+ # Electron doesn't like to run as root
25+ USER node
26+ CMD bash
You can’t perform that action at this time.
0 commit comments