Skip to content

Commit 2ff8dc7

Browse files
Merge pull request #35 from oslabs-beta/megan/dockerMac
Mac Dockerfile
2 parents 4fe67ec + 4084dcb commit 2ff8dc7

File tree

4 files changed

+1591
-0
lines changed

4 files changed

+1591
-0
lines changed

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
# RUN npx electron-rebuild
18+
19+
# Electron needs root for sand boxing
20+
# see https://github.com/electron/electron/issues/17972
21+
USER root
22+
RUN chown root /app/node_modules/electron/dist/chrome-sandbox
23+
RUN chmod 4755 /app/node_modules/electron/dist/chrome-sandbox
24+
25+
# Electron doesn't like to run as root
26+
USER node
27+
CMD bash

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)