Skip to content

Commit 4084dcb

Browse files
committed
Dockerfile for Mac
1 parent ecfc3e2 commit 4084dcb

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Dockerfile-Mac

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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

0 commit comments

Comments
 (0)