Bladeren bron

UDP ports are now exposed on the host on 0.0.0.0 be careful. Use a fw!

Klumpp, Paul-Dieter 7 jaren geleden
bovenliggende
commit
d656079323
4 gewijzigde bestanden met toevoegingen van 24 en 12 verwijderingen
  1. 1 1
      Dockerfile
  2. 8 6
      docker-compose.yml
  3. 13 4
      entrypoint.sh
  4. 2 1
      run_docker_masterserver.sh

+ 1 - 1
Dockerfile

@@ -18,5 +18,5 @@ ADD entrypoint.sh /build
 ADD src /build
 RUN chown -R buildrun:buildrun /build
 USER buildrun
-EXPOSE 27650 27000 28900 27900 27950 27951 27953
+EXPOSE 27650/udp 27000/udp 28900/udp 27900/udp 27950/udp 27951/udp 27953/udp
 ENTRYPOINT ["/build/entrypoint.sh"]

+ 8 - 6
docker-compose.yml

@@ -4,9 +4,11 @@ services:
     restart: always
     build: ./
     image: lasange:masterserver
-    deploy:
-      replicas: 1
-      resources:
-        limits:
-          cpus: "0.2"
-          memory: 2500M
+    ports:
+      - "27000/udp"
+      - "27650/udp"
+      - "27900/udp"
+      - "27950/udp"
+      - "27951/udp"
+      - "28900/udp"
+    # see https://docs.docker.com/compose/compose-file/#ports

+ 13 - 4
entrypoint.sh

@@ -1,8 +1,17 @@
 #!/bin/bash
-set -e
 cd /build/masterserver
 make
 
-./masterserver -p ./plugins
-echo The masterserver stopped. 
-sleep 1
+# delete the compiled plugins that we don't want to run:
+rm -f plugins/libef*
+
+x=1
+y=5
+while [ $x -le $y ]; do
+  echo "Starting $x/$y times"
+  x=$(( $x + 1 ))
+  ./masterserver -p ./plugins
+  echo The masterserver stopped. 
+  sleep 1
+done
+echo giving up.

+ 2 - 1
run_docker_masterserver.sh

@@ -1,3 +1,4 @@
 #!/bin/bash
-docker-compose build && docker-compose up -d
+# to change run parameters, edit docker-compose.yml
+docker-compose build  --force-rm  --pull && docker-compose up #  add a -d here to run in background