Closed Player505 closed 2 months ago
Yes, I believe you're right. I'm thinking put backup service on the same network mode and set RCON_HOST to localhost.
Yes that worked. I got an authentication error since I forgot to set the RCON password on both the minecraft and backup container but once I did that it worked well. Here is my docker compose if you are interested.
version: '3.8'
services:
lazytainer:
image: ghcr.io/vmorganp/lazytainer:master
environment:
VERBOSE: false
ports:
- 25565:25565
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
- lazytainer.group.minecraft.sleepMethod=stop
- lazytainer.group.minecraft.ports=25565
- lazytainer.group.minecraft.minPacketThreshold=2
- lazytainer.group.minecraft.inactiveTimeout=600
restart: unless-stopped
network_mode: bridge
mc:
image: itzg/minecraft-server
environment:
EULA: TRUE
TYPE: PAPER
MEMORY: 4G
VERSION: "1.20.1"
RCON_PASSWORD: minecraft
volumes:
- mc:/data
labels:
- lazytainer.group=minecraft
depends_on:
- lazytainer
network_mode: service:lazytainer
tty: true
stdin_open: true
restart: unless-stopped
backups:
image: itzg/mc-backup
network_mode: service:lazytainer
environment:
BACKUP_INTERVAL: "2h"
INITIAL_DELAY: 0
RCON_HOST: localhost
RCON_PASSWORD: minecraft
volumes:
- mc:/data:ro
- ./mc-backups:/backups
volumes:
mc: {}
I'm trying to set up a docker compose that both does backups and sleeps the minecraft container when no traffic is online. However, this doesn't appear to work. Bellow is my compose files and the console error that I get.
I'm assuming the issue is with the network mode on the minecraft container being
service:lazytainer
since the console error is about not being able to find the host. But when I add the same network mode to the backup container the issue persists.