Skip to content

Node.js docker development starter. Use this project to start, build and run a Node.js application using your local docker environment.

License

Notifications You must be signed in to change notification settings

bmeme/docker-nodejs-kickstarter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js docker development kickstarter project

Maintained? Yes GitHub last commit GitHub issues GitHub top language GitHub release (latest SemVer)

This project can be used as a starter to create a local environment to develop an application with Node.js using Docker.

The idea is that you can use docker to develop your Node.js application, without having to install anything on your system.

Top benefits:

  • easy: you can easily configure your environment with the needed tools and versions
  • isolation: you will not mess up your system, anything is containerized and could be cleared in a moment
  • consistency: Docker provides a consistent environment for your application, the same for every developer or system

TL;DR

0. Check your requirements

To use this build, you need to have Memento, Memento Kickstarter plugin and Memento Docker plugin installed. Alternatively, you can use the ./configure script.

1. Init a new project with memento kickstarter

Using memento kickstarter

Start by creating a new project using this repository as template.

memento kickstarter create nodejs

Cloning the repository manually

Start by creating a new project using this repository as template.

git clone https://github.com/bmeme/docker-nodejs-kickstarter.git

2. Define your project name and group

Using memento docker

Move to your new project dir and run memento docker configure. You will be asked a couple of questions to complete the project startup. If everything is ok you will see a basic help with some information about the available commands.

To create the docker environment for your project, run:

memento docker configure docker:create

Running the configure script

./configure docker:create

3. Check the result

Using memento docker

To interact with the container, you can use memento docker cmd. It will run the command passed to it inside the container.

You can check that everything is working by running:

memento docker cmd node --version

Eureka! If you can see node version probably anything went well, and you can start developing your awesome application!

Setting the c wrapper

eval $(./configure env)
c node --version

4. (BONUS) Go further!

Go ahead and read how to get the full potential out of your new development environment by understanding the docker environment lifecycle, how to use the wrappers and how to interact directly with your container!

Example: create a bright new React App

Suppose we want to start a new React application. Here is what you need to do to be up and running in near-zero time.

1. Use create-react-app to generate a new React app

Using memento docker

We can run create-react-app using the npx wrapper to generate a new React application:

memento docker cmd npx create-react-app app

With this command we are telling create-react-app to generate the application in the app directory.

Using the c wrapper

c npx create-react-app app

3. Try it out!

Using memento docker

When the application is successfully generated, move the app directory and run it with:

memento docker configure node:start

Pretty straightforward, isn't it?

Note: to access the application with dinghy-http-proxy or dnsdock alias, see memento docker configure output.

Using the configure script

./configure node:start

Access the container

You can run a shell directly inside the container:

memento docker cmd bash

Contributing

Any feedback, bug reports or ideas are extremely welcome.

Reach us through our website or send us an email at info@bmeme.com.

License

MIT

References

About

Node.js docker development starter. Use this project to start, build and run a Node.js application using your local docker environment.

Topics

Resources

License

Stars

Watchers

Forks