Skip to content

A NodeJS development environment, Include nginx proxy, reids sentinel, mongodb

License

Notifications You must be signed in to change notification settings

charleslxh/docker-dev

Repository files navigation

Docker-dev

A NodeJS development environment, Include nginx proxy, reids sentinel, mongodb

Run it

  1. Install libs.
$ npm install
  1. Build containers.
$ docker-compose up --build
  1. Clear all container's history logs.
for containerId in $(docker-compose ps -q);do sudo truncate -s 0 $(docker inspect --format='{{.LogPath}}' $containerId);done
  1. View logs, (use -f to follow log output).
docker-compose logs -f <service_name>
  1. Add www.example.com and api.example.com to /etc/hosts

  2. Visit http://www.example.com

Generate Self-Signed Certificate

  1. Generate a Private Key.
$ openssl genrsa -des3 -out server.key 1024
  1. Generate a CSR (Certificate Signing Request).
$ openssl req -new -key server.key -out server.csr
  1. Remove Passphrase from Key.
$ cp server.key server.key.org
$ openssl rsa -in server.key.org -out server.key
  1. Generating a Self-Signed Certificate.
$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
  1. Remove.
$ rm server.key.org && rm server.csr
$ mv server.crt ssl.crt
$ mv server.key ssl.key

About

A NodeJS development environment, Include nginx proxy, reids sentinel, mongodb

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published