Skip to content

Instantly share code, notes, and snippets.

@beastycoding
Forked from natcl/docker-compose.yaml
Created March 29, 2023 08:12
Show Gist options
  • Save beastycoding/f07e06f93ada9f2a68962667f1996a75 to your computer and use it in GitHub Desktop.
Save beastycoding/f07e06f93ada9f2a68962667f1996a75 to your computer and use it in GitHub Desktop.
docker-compose static IP example
version: '3'
networks:
mynetwork:
ipam:
config:
- subnet: 172.20.0.0/24
services:
nodered1:
image: nodered/node-red-docker
ports:
- "1880:1880"
restart: always
environment:
- TZ
- IP_BROKER=mqtt
- DOCKER=true
- PORT=1880
hostname: nodered1
networks:
mynetwork:
ipv4_address: 172.20.0.6
nodered2:
image: nodered/node-red-docker
ports:
- "1881:1880"
restart: always
environment:
- TZ
- IP_BROKER=mqtt
- DOCKER=true
- PORT=1880
hostname: nodered2
networks:
mynetwork:
ipv4_address: 172.20.0.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment