this is now handled fully inside Docker.
exception for "test_docker" job in "main-docker"
-> it seems that one needs to be there still, since it runs Playwright tests from outside the container
same changes as for the "non-alpine" Dockerfile previously commited, but adapted to Alpine.
this Dockerfile is aimed at production builds, i.e. trying to keep size as small as possible at the cost of "rebuild speed", due to missed docker cache opportunities.
Build Stage:
* do the complete build inside docker as oposed to the previous "hybrid", where tsc was run locally and the output got copied into the Docker build stage → you can now build this with Docker, without having to install the whole node/TS env locally
* build into a "build" subfolder, for easier clean up during build stage
* get rid of now unnecessary extra file/asset handling, as this is now handled by `npm run build:prepare-dist`
* no `npm prune` needed here, as we delete the whole build folder anyways in the last build step
Runtime stage:
* move the "electron" dep removal from the builder stage to the runtime stage, before installing the dependencies
* move to `npm ci` for reproducible installations – but only installing runtime deps here
* get rid of now unnecessary copying commands from the builder stage, as everything is now neatly available in "/usr/src/app"
this Dockerfile is aimed at production builds, i.e. trying to keep size as small as possible at the cost of "rebuild speed", due to missed docker cache opportunities.
Build Stage:
* do the complete build inside docker as oposed to the previous "hybrid", where tsc was run locally and the output got copied into the Docker build stage → you can now build this with Docker, without having to install the whole node/TS env locally
* build into a "build" subfolder, for easier clean up during build stage
* get rid of now unnecessary extra file/asset handling, as this is now handled by `npm run build:prepare-dist`
* no `npm prune` needed here, as we delete the whole build folder anyways in the last build step
Runtime stage:
* move the "electron" dep removal from the builder stage to the runtime stage, before installing the dependencies
* move to `npm ci` for reproducible installations – but only installing runtime deps here
* get rid of now unnecessary copying commands from the builder stage, as everything is now neatly available in "/usr/src/app"
there's no benefit from stripping "node_modules/" from the string, to later add it again using the `DEST_DIR_NODE_MODULES` constant
=> just copy directly into the `DEST_DIR` folder and preserver the `node_modules` part in the path
stop the build folder from being copied into the dist/src subfolder
→ there is no sense in doing that
→ the contents of the build folder are corretly copied previously already (see line 26ff)