Cryptkeeper / Minetrack

Minetrack makes it easy to keep an eye on your favorite Minecraft servers.
https://minetrack.me
MIT License
491 stars 220 forks source link

Newer Docker image #384

Closed CrimsonEdgeHope closed 4 months ago

CrimsonEdgeHope commented 5 months ago

Solution #225 is failing since node:15 image is based on debian 9, whose original upstream apt repository has been taken down already, causing docker reporting build failure. To even have trial, manually modifying Dockerfile to let apt client use an archive apt repository is required. Docker image based on https://github.com/Cryptkeeper/Minetrack/blob/7a76c8b45d27ebaee925906ebf8c2bf24c881c94/Dockerfile occupies more than 1GB on disk as seen from docker image ls. In addition, because servers.json and config.json all lie in the project's root directory, changing configuration or adding/removing server is with frustrating inconvenience. Worse, mounting the whole project's root directory on a new directory on host has great possibility of following data loss (Project files being wiped off upon mounting).

This PR introduces several updates:

This PR also makes patches to .gitignore and .dockerignore.

Docker Image based on the new Dockerfile reveals lower disk occupation, approximately 570MB as seen from docker image ls.

Commands listed below are used to setup my minetrack instance:


cd ~
mkdir -p trial-gh-minetrack
cd trial-gh-minetrack
git clone https://github.com/CrimsonEdgeHope/Minetrack
cd Minetrack
git fetch
git checkout origin/p1
docker build . -t gh-minetrack:trial
docker create --name gh-minetrack-trial-1 -v gh-minetrack-trial-volume:/app/data gh-minetrack:trial
cd /var/lib/docker/volumes/gh-minetrack-trial-volume/_data
cat << EOF > servers.json
[
    {
        "name": "Test",
        "ip": "example.com",
        "type": "PC"
    }
]
EOF
docker start gh-minetrack-trial-1
docker logs gh-minetrack-trial-1