[Question] How to use in Portainer Stack
- Dominant language
- Go
- Stars
- 45
- Forks
- 22
- Avg merge
- 7h 53m
- Merged PRs (30d)
- 2
Description
Hey I seriously love the Minecraft server docker container, I've used it a bunch, but I do always run into the same issue where I have to manually stop the server whenever I want to redeploy or test it, hence why I want to use this.
However here's the thing, I'm doing this all within Portainer, and I'm quite a beginner with Docker so I'm confused as to how I could implement this mc-server-runner with my Portainer stack.
Here is my current stack-
```yaml
services:
mc:
container_name: rlcraft_dregora
image: itzg/minecraft-server:java8
stdin_open: true # docker run -i
tty: true # docker run -t
restart: no # Prevent auto-start
ports:
- "43300:25565"
environment:
EULA: "TRUE"
MEMORY: 12G
TYPE: AUTO_CURSEFORGE
DEBUG: "true"
VERSION: 1.12.2
CF_PAGE_URL: "https://www.curseforge.com/minecraft/modpacks/rlcraft-dregora/files/5861566"
volumes:
- mc_forge:/data
- ./mods:/mods:ro
scheduler:
image: ubuntu:latest
container_name: minecraft_scheduler
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Allow scheduler to control Docker
command: >
bash -c "
apt-get update &&
apt-get install -y cron docker.io &&
echo '0 0 * * 6 docker start rlcraft_dregora' > /etc/cron.d/minecraft-scheduler &&
echo '0 0 * * 1 docker stop rlcraft_dregora' >> /etc/cron.d/minecraft-scheduler &&
chmod 0644 /etc/cron.d/minecraft-scheduler &&
crontab /etc/cron.d/minecraft-scheduler &&
cron -f"
restart: unless-stopped
volumes:
# declared the named volume, but use default/local storage engine
mc_forge: {}
```
I've got a fun little use case where I'm using a cron job to allow the server only to run while it's a weekend! It works, well, if you ignore the fact that I can't actually *stop* the server to begin with.
So I stumbled across this repository and figured it would be exactly what I needed!
I'm just a little stumbled as to how exactly I should implement this into my stack. I would prefer if it was something I could do in the stack file, but I figure that would make things more complicated, I would just like some help figuring out possible ways to use the wrapper for this server.
Thanks!
Contributor guide
No contributing guide indexed for this repository
Research direction
No repository file, test, or specific entry point is named in the issue. Start by reviewing the project's container entry-point usage and the provided Docker Compose stack, then determine whether Portainer is supported; done means a documented, working configuration or a clear statement of limitations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose
- Domain
- devops
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100