Browse Source

better paramaters, confirmed to run

tarfeef101 2 years ago
parent
commit
b7cfb86d26
3 changed files with 10 additions and 4 deletions
  1. 3 0
      .dockerignore
  2. 2 2
      Dockerfile
  3. 5 2
      docker-compose.yaml

+ 3 - 0
.dockerignore

@@ -0,0 +1,3 @@
+config/
+worlds/
+README.md

+ 2 - 2
Dockerfile

@@ -2,7 +2,7 @@ FROM openjdk:18-alpine
 
 WORKDIR /opt/
 
-ENV MIN_MEM=1 MAX_MEM=16
+ENV MIN_MEM=512m MAX_MEM=4G
 
 ARG VERSION=1.18.1
 
@@ -21,4 +21,4 @@ RUN apk add curl && \
     ln -s config/banned-ips.json banned-ips.json && \
     ln -s config/banned-players.json banned-players.json
 
-CMD java -Xms${MIN_MEM}G -Xmx${MAX_MEM}G -jar server.jar nogui
+CMD java -Xms${MIN_MEM} -Xmx${MAX_MEM} -jar server.jar nogui

+ 5 - 2
docker-compose.yaml

@@ -7,10 +7,13 @@ services:
       args:
         VERSION: 1.18.1
     image: tarfeef101/mc_java_vanilla:alpine-1.18.1
-    container_name: mc_javas
+    container_name: mc_java
     restart: on-failure
+    environment:
+      MIN_MEM: 512m
+      MAX_MEM: 2048m
     ports:
-      - "8009:25565"
+      - "8008:25565"
     volumes:
       - "./worlds:/opt/worlds"
       - "./config:/opt/config"