-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathcompose.yml
More file actions
83 lines (79 loc) · 2.34 KB
/
compose.yml
File metadata and controls
83 lines (79 loc) · 2.34 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
---
services:
# -- GoMud server container
server:
container_name: "go-mud-server"
build:
dockerfile: ./provisioning/Dockerfile
args:
- BIN=go-mud-server
cap_drop:
# Drop all Linux capabilities by default, then add back
# only what the server needs.
- ALL
cap_add:
# Allows a non-root process to bind the in-container HTTP port 80.
- NET_BIND_SERVICE
networks:
- mud_network
image: localhost/go-mud-server:${TAG:-latest}
environment:
SERVICE_NAME: go-mud-server
PORT: 33333
ports:
# Expose the telnet/game port and the built-in HTTP web/admin interface.
- 33333:33333
- 80:80
volumes:
# Persist logs in a named Docker volume shared with the
# log tailing sidecar.
- type: volume
source: log-volume
target: /app/log
# -- BusyBox dev container
busybox:
container_name: "server-logs"
# Lightweight sidecar container that only tails the server log file.
# This makes `docker compose up` show live application logs even though the
# main server writes them to a shared volume inside `/app/log`.
image: busybox
command:
- "tail"
- "-F"
- "/app/log/logfile.log"
volumes:
# Read the same log volume so `docker compose up` shows live server logs.
- type: volume
source: log-volume
target: /app/log
# -- Terminal dev container
terminal:
container_name: "mud-terminal"
build:
# Build a tiny interactive telnet client container for local testing.
dockerfile: ./provisioning/terminal/Dockerfile
args:
- BIN=mud-terminal
# Optional helper container used to connect to the running MUD over the
# internal Docker network, similar to opening a terminal client from a
# second machine on the same network.
stdin_open: true
tty: true
depends_on:
# Start the terminal helper after the server container is created.
- server
networks:
- mud_network
environment:
PORT: 33333
SERVICE_NAME: mud-terminal
LINES: 50
COLUMNS: 120
volumes:
# Named volume so logs survive container recreation during local development.
log-volume:
networks:
mud_network:
# Stable network name so the terminal container can always
# reach `go-mud-server`.
name: mud_network