-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
167 lines (157 loc) · 4.29 KB
/
docker-compose.yml
File metadata and controls
167 lines (157 loc) · 4.29 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
services:
# Build from GitHub
shipnetsim-builder:
build:
context: https://github.com/VTTI-CSM/ShipNetSim.git
dockerfile: Dockerfile
args:
GITHUB_BRANCH: main
image: shipnetsim:latest
container_name: shipnetsim-builder
command: echo "Build complete"
# CLI version
shipnetsim-cli:
image: shipnetsim:latest
container_name: shipnetsim-cli
volumes:
- ./data:/app/data
- ./output:/app/output
working_dir: /app
command: ./ShipNetSim
# Server versions
# |_ Host network mode (Linux - direct localhost access)
shipnetsim-server-host-network:
image: shipnetsim:latest
container_name: shipnetsim-server-host-network
environment:
- RABBITMQ_HOST=${RABBITMQ_HOST:-localhost}
- RABBITMQ_PORT=${RABBITMQ_PORT:-5672}
volumes:
- ./data:/app/data
working_dir: /app
command: sh -c "./ShipNetSimServer --hostname $${RABBITMQ_HOST:-localhost} --port $${RABBITMQ_PORT:-5672}"
network_mode: "host"
restart: unless-stopped
# |_ Bridge network mode (macOS/Windows - uses host.docker.internal)
shipnetsim-server-host-bridge:
image: shipnetsim:latest
container_name: shipnetsim-server-host-bridge
environment:
- RABBITMQ_HOST=${RABBITMQ_HOST:-localhost}
- RABBITMQ_HOST_RESOLVED=${RABBITMQ_HOST_RESOLVED:-host.docker.internal}
- RABBITMQ_PORT=${RABBITMQ_PORT:-5672}
volumes:
- ./data:/app/data
working_dir: /app
command: sh -c "./ShipNetSimServer --hostname $${RABBITMQ_HOST_RESOLVED:-host.docker.internal} --port $${RABBITMQ_PORT:-5672}"
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
# GUI version (Linux)
shipnetsim-gui-linux:
image: shipnetsim:latest
container_name: shipnetsim-gui
environment:
- DISPLAY=${DISPLAY}
- QT_X11_NO_MITSHM=1
- LIBGL_ALWAYS_INDIRECT=0
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./data:/app/data
- ./output:/app/output
devices:
- /dev/dri:/dev/dri
working_dir: /app
command: ./ShipNetSimGUI
network_mode: host
user: root
profiles:
- linux
# GUI version (macOS)
shipnetsim-gui-macos:
image: shipnetsim:latest
container_name: shipnetsim-gui
environment:
- DISPLAY=host.docker.internal:0
- QT_X11_NO_MITSHM=1
- LIBGL_ALWAYS_INDIRECT=1
volumes:
- ./data:/app/data
- ./output:/app/output
extra_hosts:
- "host.docker.internal:host-gateway"
working_dir: /app
command: ./ShipNetSimGUI
user: root
profiles:
- macos
# GUI version (Windows/WSL)
shipnetsim-gui-windows:
image: shipnetsim:latest
container_name: shipnetsim-gui
environment:
- DISPLAY=host.docker.internal:0
- QT_X11_NO_MITSHM=1
- LIBGL_ALWAYS_INDIRECT=1
volumes:
- ./data:/app/data
- ./output:/app/output
extra_hosts:
- "host.docker.internal:host-gateway"
working_dir: /app
command: ./ShipNetSimGUI
user: root
profiles:
- windows
# GUI version (WSLg - Windows 11)
shipnetsim-gui-wslg:
image: shipnetsim:latest
container_name: shipnetsim-gui
environment:
- DISPLAY=${DISPLAY}
- WAYLAND_DISPLAY=${WAYLAND_DISPLAY}
- QT_X11_NO_MITSHM=1
- LIBGL_ALWAYS_INDIRECT=0
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- /mnt/wslg:/mnt/wslg:rw
- ./data:/app/data
- ./output:/app/output
working_dir: /app
command: ./ShipNetSimGUI
user: root
profiles:
- wslg
# Development environment
shipnetsim-dev:
build:
context: https://github.com/VTTI-CSM/ShipNetSim.git
dockerfile: Dockerfile
target: builder
image: shipnetsim:dev
container_name: shipnetsim-dev
environment:
- DISPLAY=${DISPLAY}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./workspace:/workspace
working_dir: /app
command: /bin/bash
stdin_open: true
tty: true
network_mode: host
# RabbitMQ service
rabbitmq:
image: rabbitmq:3-management
container_name: shipnetsim-rabbitmq
ports:
- "5672:5672"
- "15672:15672"
environment:
- RABBITMQ_DEFAULT_USER=admin
- RABBITMQ_DEFAULT_PASS=admin
networks:
- shipnetsim-network
networks:
shipnetsim-network:
driver: bridge