File tree Expand file tree Collapse file tree 3 files changed +37
-11
lines changed Expand file tree Collapse file tree 3 files changed +37
-11
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [ Unreleased]
9
9
10
+ ### Fixed
11
+
12
+ - Fixed bug where servers started when they shouldn't
13
+
10
14
## [ 2.6.0] - 2024-10-30
11
15
12
16
### Changed
Original file line number Diff line number Diff line change
1
+ # Lazymc requires that the minecraft server have a static IP.
2
+ #
3
+ # To ensure that our servers have a static IP we need to create
4
+ # a network for our services to use.
5
+ #
6
+ # By default, Docker uses 172.17.0.0/16 subnet range.
7
+ # So we need to create a new network in a different subnet
8
+ # See the readme for more information.
9
+ #
10
+ # Please ensure that the subnet falls within the private CIDRs:
11
+ # https://datatracker.ietf.org/doc/html/rfc1918#section-3
12
+ #
13
+ # And that it is not in use by anything else.
14
+ networks :
15
+ minecraft-network :
16
+ driver : bridge
17
+ ipam :
18
+ config :
19
+ - subnet : 172.18.0.0/16
20
+
1
21
services :
2
22
lazymc :
3
- image : ghcr.io/joesturge/lazymc-docker-proxy:latest
23
+ build : .
24
+ # the IPs should start at .2 as .1 is reserved for the gateway
25
+ networks :
26
+ minecraft-network :
27
+ ipv4_address : 172.18.0.2
4
28
restart : unless-stopped
29
+ environment :
30
+ RUST_LOG : " debug"
5
31
volumes :
6
32
# you should mount the minecraft server dir under /server, using read only.
7
33
- data:/server:ro
@@ -15,6 +41,10 @@ services:
15
41
# Standard Docker Minecraft server, also works with other server types
16
42
mc :
17
43
image : itzg/minecraft-server:java21
44
+ # Assign a static IP to the server container
45
+ networks :
46
+ minecraft-network :
47
+ ipv4_address : 172.18.0.3
18
48
# We need to add a label here so that lazymc-docker-proxy knows which
19
49
# container to manage
20
50
labels :
Original file line number Diff line number Diff line change @@ -254,15 +254,7 @@ impl Config {
254
254
255
255
let join_forward_section: JoinForwardSection = JoinForwardSection {
256
256
address : labels
257
- . get ( "lazymc.join.forward.address" )
258
- . and_then ( |address| address. to_socket_addrs ( ) . ok ( ) )
259
- . and_then ( |addrs| addrs. filter ( |addr| addr. is_ipv4 ( ) ) . next ( ) )
260
- . and_then ( |addr| addr. to_string ( ) . parse ( ) . ok ( ) )
261
- . or_else ( || {
262
- warn ! ( target: "lazymc-docker-proxy::entrypoint::config" , "Failed to resolve IP address from lazymc.join.forward.address. Falling back to the value provided." ) ;
263
- resolved_ip = false ;
264
- labels. get ( "lazymc.join.forward.address" ) . cloned ( )
265
- } ) ,
257
+ . get ( "lazymc.join.forward.address" ) . cloned ( ) ,
266
258
send_proxy_v2 : labels
267
259
. get ( "lazymc.join.forward.send_proxy_v2" )
268
260
. map ( |x| x == "true" ) ,
@@ -286,7 +278,7 @@ impl Config {
286
278
. map ( |s| s. to_string ( ) )
287
279
. collect ( ) )
288
280
. filter ( |m : & Vec < String > | !m. is_empty ( ) )
289
- } ) ,
281
+ } ) . or_else ( || None ) ,
290
282
kick : join_kick_section. clone ( ) ,
291
283
hold : join_hold_section. clone ( ) ,
292
284
forward : join_forward_section. clone ( ) ,
You can’t perform that action at this time.
0 commit comments