FROM renyufu/electron-packager AS build-env
COPY package.json package-lock.json /electron/
COPY . /electron
RUN npm i && npm i --save-dev electron && mkdir dist
RUN electron-packager . --platform linux --arch x64 --out dist/
RUN electron-packager . --platform darwin --arch x64 --out dist/
RUN electron-packager . --platform win32 --arch x64 --out dist/
FROM nginx:alpine
COPY --from=build-env /electron/dist /usr/share/nginx/html
RUN chmod 555 -R /usr/share/nginx/html