8 Make
Make automates common shell commands into named targets. On an ndexr server, the Makefile in ~/public/ provides shortcuts for the Docker Compose workflow.
8.1 The ndexr Makefile
scale = 2
profile = ndexrio
logs:
docker compose --profile=$(profile) logs -f
down:
docker compose --profile=$(profile) down
build:
docker compose --profile=$(profile) build
buildnc:
docker compose --profile=$(profile) build --no-cache
upnc: buildnc scale
docker compose --profile=$(profile) up -d --remove-orphans
up: build scale
docker compose --profile=$(profile) up -d --remove-orphans
scale:
docker compose --profile=$(profile) up --scale $(profile)=$(scale) -d8.2 Common commands
Start the Shiny app with 10 workers:
make up profile=ndexrio scale=10Start the database services:
make up profile=dbWatch logs:
make logs profile=ndexrioStop everything:
make down profile=ndexrioRebuild without cache (useful when dependencies change):
make upnc profile=ndexrio scale=108.3 How it connects
Running make up profile=ndexrio scale=10:
- Make calls
docker compose buildto build the container image - Make calls
docker compose up --scale ndexrio=10to start 10 instances - Each instance gets a port from the
9001-9010range - NGINX is already configured to distribute traffic across those ports
You can add your own targets to the Makefile for anything you repeat — deploying a specific service, running database migrations, pulling updated configs.