-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
87 lines (82 loc) · 2.46 KB
/
docker-compose.yml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
version: '3.4'
services:
# The management-console is started to run message explorer.
# See the README.md file for further details.
management-console:
build:
context: .
dockerfile: docker/Dockerfile
target: management-console
depends_on:
change-vol-ownership:
condition: service_completed_successfully
volumes:
- management-console:/app
ports:
- "127.0.0.1:8080:8080"
# The iota-bridge can be accessed via
# * localhost:50000
# * port 50000 of the external ip address of the docker host
# * iota-bridge:50000 from within other docker containers
iota-bridge:
build:
context: .
dockerfile: docker/Dockerfile
target: iota-bridge
depends_on:
change-vol-ownership:
condition: service_completed_successfully
volumes:
- iota-bridge:/app
ports:
- "50000:50000"
# The app-srv-connector-mock can be accessed via
# * localhost:50001
# # * port 50001 of the external ip address of the docker host
# # * app-srv-connector-mock:50001 from within other docker containers
app-srv-connector-mock:
build:
context: .
dockerfile: docker/Dockerfile
target: app-srv-connector-mock
ports:
- "50001:50001"
# The sensor will try to send messages after startup. This will fail, if the sensor has not been
# initialized before. See the README.md file for further details.
sensor:
build:
context: .
dockerfile: docker/Dockerfile
target: sensor
depends_on:
change-vol-ownership:
condition: service_completed_successfully
volumes:
- sensor:/app
# Fix Ownership issues using the needed volumes
# This solution is inspired by
# https://pratikpc.medium.com/use-docker-compose-named-volumes-as-non-root-within-your-containers-1911eb30f731
change-vol-ownership:
# We can use any image we want as long as we can chown
image: debian:bullseye-slim
# Need a user priviliged enough to chown
user: "root"
# Specify the group in question
group_add:
- "65532"
volumes:
# The volume to chown
- management-console:/tmp/change-ownership/m_c
- iota-bridge:/tmp/change-ownership/i_b
- sensor:/tmp/change-ownership/sensor
command:
- "chown"
- "-R"
- "65532:65532"
- "/tmp/change-ownership/m_c"
- "/tmp/change-ownership/i_b"
- "/tmp/change-ownership/sensor"
volumes:
management-console:
iota-bridge:
sensor: