diff --git a/.dockerignore b/.dockerignore index 98253acf..c3fba8ca 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1 @@ -* -!requirements.txt +/.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..827403c1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,45 @@ +FROM balenalib/aarch64-debian-node:10-buster-build as builder + +RUN apt-get update +RUN apt-get install python + +WORKDIR /usr/src/app + +ENV npm_config_disturl=https://electronjs.org/headers +ENV npm_config_runtime=electron +ENV npm_config_target=7.1.14 + +COPY src src +COPY scripts scripts +COPY typings typings +COPY binding.gyp tsconfig.json npm-shrinkwrap.json package.json ./ + +RUN npm i + +COPY assets assets +COPY lib lib +COPY tsconfig.json webpack.config.ts ./ + +RUN npm run webpack + +FROM alexisresinio/aarch64-debian-bejs:latest +COPY --from=builder /usr/src/app/node_modules /usr/src/app/node_modules +COPY --from=builder /usr/src/app/generated /usr/src/app/generated +COPY --from=builder /usr/src/app/assets /usr/src/app/assets +COPY --from=builder /usr/src/app/build /usr/src/app/build +COPY --from=builder /usr/src/app/lib /usr/src/app/lib +COPY --from=builder /usr/src/app/package.json /usr/src/app/package.json + +# TODO: remove once we have a screen +ENV VNC_PASSWORD=password + +ENV ELECTRON_ENABLE_LOGGING=1 + +ENV UDEV=1 + +RUN mkdir /tmp/media +ENV BALENA_ELECTRONJS_MOUNTS_ROOT=/tmp/media +ENV BALENA_ELECTRONJS_CONSTRAINT_PATH=/tmp/media + +# Etcher configuration +COPY etcher-pro-config.json /root/.config/balena-etcher/config.json diff --git a/etcher-pro-config.json b/etcher-pro-config.json new file mode 100644 index 00000000..ed010d03 --- /dev/null +++ b/etcher-pro-config.json @@ -0,0 +1,102 @@ +{ + "unsafeMode": false, + "errorReporting": true, + "unmountOnSuccess": true, + "validateWriteOnSuccess": true, + "trim": true, + "updatesEnabled": true, + "lastSleptUpdateNotifier": null, + "lastSleptUpdateNotifierVersion": null, + "desktopNotifications": false, + "fullscreen": true, + "driveBlacklist": [ + "/dev/mmcblk0rpmb", + "/dev/mmcblk0", + "/dev/mmcblk0boot0", + "/dev/mmcblk0boot1" + ], + "disableExternalLinks": true, + "disableUnsafeMode": true, + "ledsMapping": { + "platform-xhci-hcd.0.auto-usb-0:1.1.1:1.0-scsi-0:0:0:0": [ + "led1_r", + "led1_g", + "led1_b" + ], + "platform-xhci-hcd.0.auto-usb-0:1.1.2:1.0-scsi-0:0:0:0": [ + "led2_r", + "led2_g", + "led2_b" + ], + "platform-xhci-hcd.0.auto-usb-0:1.1.3:1.0-scsi-0:0:0:0": [ + "led3_r", + "led3_g", + "led3_b" + ], + "platform-xhci-hcd.0.auto-usb-0:1.1.4:1.0-scsi-0:0:0:0": [ + "led4_r", + "led4_g", + "led4_b" + ], + "platform-xhci-hcd.0.auto-usb-0:1.2.1:1.0-scsi-0:0:0:0": [ + "led5_r", + "led5_g", + "led5_b" + ], + "platform-xhci-hcd.0.auto-usb-0:1.2.2:1.0-scsi-0:0:0:0": [ + "led6_r", + "led6_g", + "led6_b" + ], + "platform-xhci-hcd.0.auto-usb-0:1.2.3:1.0-scsi-0:0:0:0": [ + "led7_r", + "led7_g", + "led7_b" + ], + "platform-xhci-hcd.0.auto-usb-0:1.2.4:1.0-scsi-0:0:0:0": [ + "led8_r", + "led8_g", + "led8_b" + ], + "platform-xhci-hcd.1.auto-usb-0:1.1.1:1.0-scsi-0:0:0:0": [ + "led9_r", + "led9_g", + "led9_b" + ], + "platform-xhci-hcd.1.auto-usb-0:1.1.2:1.0-scsi-0:0:0:0": [ + "led10_r", + "led10_g", + "led10_b" + ], + "platform-xhci-hcd.1.auto-usb-0:1.1.3:1.0-scsi-0:0:0:0": [ + "led11_r", + "led11_g", + "led11_b" + ], + "platform-xhci-hcd.1.auto-usb-0:1.1.4:1.0-scsi-0:0:0:0": [ + "led12_r", + "led12_g", + "led12_b" + ], + "platform-xhci-hcd.1.auto-usb-0:1.2.1:1.0-scsi-0:0:0:0": [ + "led13_r", + "led13_g", + "led13_b" + ], + "platform-xhci-hcd.1.auto-usb-0:1.2.2:1.0-scsi-0:0:0:0": [ + "led14_r", + "led14_g", + "led14_b" + ], + "platform-xhci-hcd.1.auto-usb-0:1.2.3:1.0-scsi-0:0:0:0": [ + "led15_r", + "led15_g", + "led15_b" + ], + "platform-xhci-hcd.1.auto-usb-0:1.2.4:1.0-scsi-0:0:0:0": [ + "led16_r", + "led16_g", + "led16_b" + ] + } +}