-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
147 lines (137 loc) · 4.84 KB
/
docker-compose.yml
File metadata and controls
147 lines (137 loc) · 4.84 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
# Example docker composition for starting up a mooR system, with a telnet server and a web server, and a worker process
# for handling outbound HTTP requests.
# This could be used as a starting point for a production system, and uses release builds of the mooR system as built
# by the Dockerfile in the root of the repository. A real production system would definitely need to consider its
# security and network layout, and this is just a simple example to get started with.
# The first time the system starts, it will import cores/lambda-moor from the cores directory.
# This is a fork of LambdaCore, reconstituted in mooR's `objdef` format, with some modifications.
# To import an existing LambdaMOO 1.8.x DB, change --import to point to it, and change --import-format to textdump
# After import, `moor-data` will contain the database that resulted.
# To re-import simply delete this directory.
# After this is running, a MUD client / telnet client can connect to port 8888 on localhost to interact with the
# system. (e.g. telnet localhost 8888). Or a websocket client can connect to port 8080 on localhost.
networks:
# An internal network for the mooR system, to allow the different components to communicate with each other.
# Note: We could use IPC sockets instead, and it would be more efficient, but by using TCP we can give an example
# of how to use the system over a network if we were in a real distributed system.
moor_net:
services:
# The core Moor daemon, which handles the database, scheduling and execution of tasks, and hosts the RPC server.
moor-daemon:
build:
context: .
target: backend
network: host
args:
BUILD_PROFILE: ${BUILD_PROFILE:-debug}
container_name: "moor-daemon"
environment:
- RUST_BACKTRACE=1
working_dir: /moor
volumes:
- ./game/db:/db
- ./game/objects:/core
command: >
./moor-daemon /db/development.db
--rpc-listen=tcp://0.0.0.0:7899
--events-listen=tcp://0.0.0.0:7898
--workers-response-listen=tcp://0.0.0.0:7897
--workers-request-listen=tcp://0.0.0.0:7896
--import=/core --import-format=objdef
--use-symbols-in-builtins false
--symbol-type=false
--custom-errors true
--anonymous-objects true
--use-uuobjids true
ports:
# ZMQ ports
- "7899:7899" # RPC listener
- "7898:7898" # Events listener
- "7897:7897" # Workers response listener
- "7896:7896" # Workers request listener
networks:
- moor_net
# A host process that runs the telnet server, and handles incoming connections and forwards events to the daemon.
moor-telnet-host:
build:
context: .
target: backend
network: host
args:
BUILD_PROFILE: ${BUILD_PROFILE:-debug}
container_name: "moor-telnet-host"
environment:
- RUST_BACKTRACE=1
working_dir: /moor
command: >
./moor-telnet-host --telnet-address=0.0.0.0
--telnet-port=8888
--rpc-address=tcp://moor-daemon:7899
--events-address=tcp://moor-daemon:7898
ports:
# Telnet listener
- "8888:8888"
networks:
- moor_net
# A worker process that handles requests from the daemon for outbound HTTP requests and returns the results back
# to the daemon.
moor-curl-worker:
build:
context: .
target: backend
network: host
args:
BUILD_PROFILE: ${BUILD_PROFILE:-debug}
container_name: "moor-curl-worker"
environment:
- RUST_BACKTRACE=1
working_dir: /moor
command: >
./moor-curl-worker
--rpc-address=tcp://moor-daemon:7899
--events-address=tcp://moor-daemon:7898
--workers-request-address=tcp://moor-daemon:7896
--workers-response-address=tcp://moor-daemon:7897
networks:
- moor_net
moor-vcs-worker:
build:
context: .
target: backend
network: host
args:
BUILD_PROFILE: ${BUILD_PROFILE:-debug}
container_name: "moor-vcs-worker"
environment:
- RUST_BACKTRACE=1
- VCS_DB_PATH=/game
- VCS_GAME_NAME=HackerCore
working_dir: /moor
volumes:
- ./game:/game
command: >
./moor-vcs-worker
--rpc-address=tcp://moor-daemon:7899
--events-address=tcp://moor-daemon:7898
--workers-request-address=tcp://moor-daemon:7896
--workers-response-address=tcp://moor-daemon:7897
--http-address=0.0.0.0:9998
ports:
# HTTP API and Swagger UI
- "9998:9998"
networks:
- moor_net
dome-client:
build:
context: vendor/dome-client
container_name: "dome-client"
environment:
- DOME_NODE_MODE=production
- DOME_NODE_PORT=9999
- DOME_MOO_HOST=moor-telnet-host
- DOME_MOO_PORT=8888
- DOME_NODE_SOCKETURL=http://localhost:9999
ports:
- "9999:9999"
networks:
- moor_net