A NodeJS development environment, Include nginx proxy, reids sentinel, mongodb
- Install libs.
$ npm install
- Build containers.
$ docker-compose up --build
- Clear all container's history logs.
for containerId in $(docker-compose ps -q);do sudo truncate -s 0 $(docker inspect --format='{{.LogPath}}' $containerId);done
- View logs, (use
-f
to follow log output).
docker-compose logs -f <service_name>
-
Add
www.example.com
andapi.example.com
to/etc/hosts
-
Visit http://www.example.com
- Generate a Private Key.
$ openssl genrsa -des3 -out server.key 1024
- Generate a CSR (Certificate Signing Request).
$ openssl req -new -key server.key -out server.csr
- Remove Passphrase from Key.
$ cp server.key server.key.org
$ openssl rsa -in server.key.org -out server.key
- Generating a Self-Signed Certificate.
$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
- Remove.
$ rm server.key.org && rm server.csr
$ mv server.crt ssl.crt
$ mv server.key ssl.key