forked from sfera-labs/exo-sense-py-modbus
-
Notifications
You must be signed in to change notification settings - Fork 48
/
docker-compose.yaml
58 lines (53 loc) · 1.45 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
#
# build all non-image containers
# $ docker-compose build
# can be combined into one command to also start it afterwards
# $ docker-compose up --build
#
version: "3.8"
services:
micropython-client:
build:
context: .
dockerfile: Dockerfile.client_tcp
container_name: micropython-client
volumes:
- ./:/home
- ./umodbus:/root/.micropython/lib/umodbus
expose:
- "502"
ports:
# reach "micropython-client" at 172.24.0.2:502, see networks
- "502:502"
networks:
my_bridge:
# fix IPv4 address to be known and in the MicroPython scripts
# https://docs.docker.com/compose/compose-file/#ipv4_address
ipv4_address: 172.24.0.2
micropython-host:
build:
context: .
dockerfile: Dockerfile.host_tcp
container_name: micropython-host
volumes:
- ./:/home
- ./umodbus:/root/.micropython/lib/umodbus
depends_on:
- micropython-client
networks:
my_bridge:
# fix IPv4 address to be known and in the MicroPython scripts
# https://docs.docker.com/compose/compose-file/#ipv4_address
ipv4_address: 172.24.0.3
networks:
my_bridge:
# use "external: true" if the network already exists
# check available networks with "docker network ls"
# external: true
driver: bridge
# https://docs.docker.com/compose/compose-file/#ipam
ipam:
config:
- subnet: 172.24.0.0/16
gateway: 172.24.0.1