You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

44 lines
1015 B

OS_PERMS=sudo
IMAGE_NAME=nethack-server
NETHACK_DIR=$(shell pwd)/savedata
all: run
run: savedata
$(OS_PERMS) docker run \
-d \
-p 23:23 \
-p 8080:8080 \
-v $(NETHACK_DIR)/var:/opt/nethack/nethack.alt.org/nh343/var:rw \
-v $(NETHACK_DIR)/dgldir:/opt/nethack/nethack.alt.org/dgldir:rw \
--name=nethack \
--restart always \
$(IMAGE_NAME)
build:
mkdir -p stage.tmp/
cp deps/chowner.sh stage.tmp/
cp deps/dgamelaunch.conf stage.tmp/
cp deps/Dockerfile stage.tmp/
cp deps/reclist stage.tmp/
cp deps/nethack-score stage.tmp/
cp deps/run.sh stage.tmp/
cd stage.tmp/ && \
$(OS_PERMS) docker build -t $(IMAGE_NAME) .
generate_api_binaries:
git clone https://git.unixvoid.com/mfaltys/nethack-score-api
cd nethack-score-api && \
make dependencies && \
make stat reclist
cp nethack-score-api/bin/nethack-score deps/
cp nethack-score-api/bin/reclist deps/
rm -rf nethack-score-api
savedata:
tar -xzf deps/initial_savedata.tar.gz
clean:
rm -rf stage.tmp/
rm -rf nethack-score-api/