https://github.com/nullstone-io/docker-node
Base docker image for Node
https://github.com/nullstone-io/docker-node
Last synced: 8 months ago
JSON representation
Base docker image for Node
- Host: GitHub
- URL: https://github.com/nullstone-io/docker-node
- Owner: nullstone-io
- License: mit
- Created: 2022-05-06T21:04:53.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2025-02-05T14:06:18.000Z (over 1 year ago)
- Last Synced: 2025-02-05T15:23:49.727Z (over 1 year ago)
- Language: Shell
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nullstone/node
Node Base Image that is configured with different image tags for local and production.
This image is opinionated, but not restrictive.
## Quick Reference
- Maintained by
[Nullstone](https://nullstone.io)
- Where to get help
[Nullstone Slack](https://join.slack.com/t/nullstone-community/signup)
## Supported Tags and respective `Dockerfile` links
- [local](local.Dockerfile)
- [latest](Dockerfile)
- [lambda, lambda-22](lambda.Dockerfile)
- [lambda-20](lambda.Dockerfile)
- [lambda-18](lambda.Dockerfile)
- [lambda-16](lambda.Dockerfile)
- [lambda-14](lambda.Dockerfile)
- [lambda-12](lambda.Dockerfile)
## Variants
This repository builds 3 variants of images: a local image, a production container image, and a production serverless image.
### Local
The local image variant is used to run node in an isolated development environment on your local machine.
- `CMD` is set to `node app.js` to run a development server.
- `PORT` is set to `9000` to align with Nullstone conventions to quickly attach nginx sidecar (example coming soon)
- `ENTRYPOINT` is set to a custom entrypoint script that does the following:
- Run `yarn install` - Allows developer to run `docker compose restart app` to make changes to dependencies
- If `POSTGRES_URL` is specified, set `DB_ADAPTER=postgresql`, `DATABASE_URL=$POSTGRES_URL`
- If `MYSQL_URL` is specified, set `DB_ADAPTER=mysql`, `DATABASE_URL=$MYSQL_URL`
### Production
The production image variant uses node to run a node app in production mode.
- `PORT` is set to `80`
- `ENTRYPOINT` is set to a custom entrypoint script that does the following:
- If `POSTGRES_URL` is specified, set `DB_ADAPTER=postgresql`, `DATABASE_URL=$POSTGRES_URL`
- If `MYSQL_URL` is specified, set `DB_ADAPTER=mysql`, `DATABASE_URL=$MYSQL_URL`