Deploying RedBot in production often requires domain and an SSL certificates to work with chat platforms callbacks (i.e., Facebook Messenger, Slack, etc).

The following architecture uses Docker and Nginx

flowchart TD
  browser[Browser]
  subgraph server [*.mydomain.com]
	nginx[[Nginx reverse proxy]]
	redbot1(redbot1: RedBot server #1)
  redbotN(redbotN: RedBot server #N) 
  end
  browser <==> server
  nginx <== redbot1:1880 ==> redbot1
  nginx <== redbotN:1880 ==> redbotN

The Node-RED / RedBot server runs behind the reverse proxy pretty much in the same way it would run locally in development environment (plain http calls on port 1880) excepts for the REDBOT_ENVIRONMENT set to production.

Main benefits

Pre-requisites:

Step 1

Create a docker-compose.yml like the following

version: '3.3'
services:
  redbot1:
    environment:
      - REDBOT_HOST=redbot1.mydomain.com
      - REDBOT_ENABLE_MISSION_CONTROL=true
      - NODE_RED_ENABLE_PROJECTS=false
      - REDBOT_ENVIRONMENT=production
    user: 1000:1000
    restart: always
    volumes:
      - '/mnt/myvolume/redbot1:/data'
    ports:
      - '1880:1880'
    container_name: redbot1
    image: guidone/redbot
    networks:
      - redbotnet

  nginx:
    image: 'jc21/nginx-proxy-manager:latest'
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    networks:
      - redbotnet
      - outside
    container_name: nginx
    environment:
      DB_SQLITE_FILE: '/data/database.sqlite'
    volumes:
      - '/mnt/myvolume/nginx/data:/data'
      - '/mnt/myvolume/nginx/letsencrypt:/etc/letsencrypt'
  
networks:
  guidonet:
    driver: bridge
  outside:
    external: true