A starting point for containerized Node.js 6.9 applications. Based on RAD Container: https://github.com/frog/rad-container
To begin developing your Node.js application, you must have the latest version of Docker installed on your system. If you are using an older version of Docker, please uninstall it and use the appropriate installer from the docker website.
https://docs.docker.com/engine/installation/
Once Docker is installed on your machine, follow the steps below to begin developing your application. This is intended for local development, and will map your project root directory into the container and auto restart the application when changes are made.
- Navigate to your project root directory and copy the contents of this repository to that location.
- Create a copy of
make_env.distand rename it tomake_env. Update with your project specific information. make buildmake shellnpm installnpm start
- If successful, you will see "Application running on port: 3000" in your console.
- In a web browser, navigate to 'http://localhost:3000' and you will see "Hello world!".
You may pass additional environment variables to your container by including them in your make_env file. Follow these steps to add new environment variables. If you have an existing container that is running, you must rebuild and restart it for changes to make_env to take effect.
- Add your environment variables to your
make_envfile inside the DOCKER_ENV declaration. Remember, the last line does not get a trailing slash. - Build (or rebuild) your container using
make build. - Start (or restart) your container using
make startormake shell.
The following commands are intended to make working with Docker faster and easier on your local machine.
buildBuilds your container from the instructions in your Dockerfile.pushPushes your continer image to the Docker Hub repository specified in your make_env file.shellStarts your continer and automatically logs into it via SSH.runRuns the container with stdout.startRuns the container in daemon mode - it will run in the background and you can attach to it at any time.restartStarts a stopped container.stopStops the running container.rmRemoves your container.releaseBuilds your container image and then pushes it to the Docker Hub repository specified in your make_env file.initAn initialization command intended for seeding an application. Blank by default.