This is an onbuild container for Node.JS Projects.
This docker container is an ONBUILD
. Simply extend the Dockerfile in your application with this Dockerfile and your
project will be copied into the /app
directory and have npm install
run on it. You must ensure that your
downstream images sets USER nodejs and additionally in rare cases any required permission beyond read. You must also ensure that your application will listen on port 8080.
Please note, storing state on this container is not recommended, and logs should be written to stdout, thus adding further permissions isn't something we'd normally envision.
start
,test
orrun
will runnpm COMMAND
The following command will run npm start
on the code within the container
So if your Dockerfile looks like this
FROM quay.io/ukhomeofficedigital/nodejs:v3.0.0
USER nodejs
CMD ["start"]
The following will run npm start
:
docker run your-docker-container:latest
You can also run arbitrary commands such as:
docker run your-docker-container:latest /opt/nodejs/bin/npm run
However, we'd prefered there was a standard way to start your app and thus,
have settled on npm start
being the canonical way to run your app.
/app
- Where you app will be copied to on build
Feel free to submit pull requests and issues. If it's a particularly large PR, you may wish to discuss it in an issue first.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
We use SemVer for the version tags available See the tags on this repository.
- Node v4.4.2
- Billie Thompson - Initial work - PurpleBooth
See also the list of contributors who participated in this project.
This project is licensed under the GPL v2 License - see the LICENSE.md file for details