Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gas-buddy/node-docker-build-action
Build a GasBuddy node app container for Typescript/yarn based Node services
https://github.com/gas-buddy/node-docker-build-action
Last synced: about 2 months ago
JSON representation
Build a GasBuddy node app container for Typescript/yarn based Node services
- Host: GitHub
- URL: https://github.com/gas-buddy/node-docker-build-action
- Owner: gas-buddy
- License: other
- Created: 2022-10-11T17:19:44.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-18T15:30:45.000Z (7 months ago)
- Last Synced: 2024-10-31T10:38:16.471Z (3 months ago)
- Language: Dockerfile
- Size: 18.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
node-docker-build-action
===Build a GasBuddy service into a docker container and deploy it to an container registry.
Uses node:18.10-bullseye for installing packages and building and then gcr.io/distroless/nodejs-debian11:18
at runtime. At time of writing, minimal service container size was about 230MB. Previous alpine based
images were 80MB, so this isn't great, but I think having a standard, modern, and secure container
like gcr distroless is probably worth the tradeoff. Additionally, with multistage builds, the app layers are
only about 70MB (depending on your app - lookout for unnecessary dependencies), and so the actual "weight"
of moving assets per image is much lower. Also, for the way we use these images, we chose to copy busybox
onto distroless, which is a little against the point of distroless.Notes
==
The Dockerfile copies only selected directories, so you must be careful about where you place files that you want to be in the runtime image. The following directories are copied:* build - Typically where built code is placed
* build-static - Typically where resource bundles generated for web pages are placed
* static - Publicly available files needed for web pages can be placed here such as favicon
* src - Copied for debuggability, but perhaps should be removed
* config - Configuration and keys - development.json and test.json will be removed
* migrations - Database migrations
* api - Api specification
* public - Any static files such as images, client side Javascript, etc.
* private - Any resources needed that are NOT to be served out but needed at runtimeAnd of course node_modules is built by installing production packages in the binary format of the container.
Practically, what this means is that if you have assets that you need at runtime that are not in the source directory, you should place them in config, private or public.