Skip to content

Deploy Ruby + PostgreSQL + Nginx (NTM stack)

John Sundarraj edited this page Oct 15, 2024 · 1 revision

Modify hosts

Windows

# Modify hosts configuration.
$ notepad C:\Windows\System32\drivers\etc\hosts
192.168.101.6  app.ntm.sloopstash.dv app-static.ntm.sloopstash.dv
192.168.101.6  app.ntm.sloopstash.qaa app-static.ntm.sloopstash.qaa
192.168.101.6  app.ntm.sloopstash.qab app-static.ntm.sloopstash.qab

Mac and Linux

# Modify hosts configuration.
$ sudo nano /etc/hosts
192.168.101.6  app.ntm.sloopstash.dv  app-static.ntm.sloopstash.dv
192.168.101.6  app.ntm.sloopstash.qaa app-static.ntm.sloopstash.qaa
192.168.101.6  app.ntm.sloopstash.qab app-static.ntm.sloopstash.qab

Configure environment variables

Supported environment variables

# Allowed values for $ENVIRONMENT variable.
* dev
* qaa
* qab

Set environment variables

# Store environment variables.
$ export ENVIRONMENT=dev

Bootstrap NTM stack environment

Docker

# Switch to Docker starter-kit directory.
$ cd /opt/kickstart-docker

# Provision OCI containers using Docker compose.
$ sudo docker compose -f compose/ntm.yml --env-file compose/${ENVIRONMENT^^}.env -p sloopstash-${ENVIRONMENT}-ntm up -d

Manage NTM stack environments

Docker

# Switch to Docker starter-kit directory.
$ cd /opt/kickstart-docker

# Stop OCI containers using Docker compose.
$ sudo docker compose -f compose/ntm.yml --env-file compose/${ENVIRONMENT^^}.env -p sloopstash-${ENVIRONMENT}-ntm down

# Restart OCI containers using Docker compose.
$ sudo docker compose -f compose/ntm.yml --env-file compose/${ENVIRONMENT^^}.env -p sloopstash-${ENVIRONMENT}-ntm restart