backend: Create npm script package
This script creates a directory `backend/package` which only contains the files required by the backend at runtime: - The contents of `dist` - `node_modules` minus `typescript` and `@typescript-eslint`. These packages are build-only and are larger than the remaining whole package. By using only `backend/package` in the Docker image, the backend content size in the image is decreased by 70% to 31M. This, along with the improved copying in the Dockerfile, reduces the backend image size by 44% to 200M. (Step `RUN chown -R 1000:1000 /backend ...` created a layer that effectively duplicated the backend.)
This commit is contained in:
2
docker/backend/start.sh
Normal file → Executable file
2
docker/backend/start.sh
Normal file → Executable file
@@ -205,4 +205,4 @@ sed -i "s!__LND_REST_API_URL__!${__LND_REST_API_URL__}!g" mempool-config.json
|
||||
# CLN
|
||||
sed -i "s!__CLN_SOCKET__!${__CLN_SOCKET__}!g" mempool-config.json
|
||||
|
||||
node /backend/dist/index.js
|
||||
node /backend/package/index.js
|
||||
|
||||
Reference in New Issue
Block a user