Jelajahi Sumber

first draft, but continue on a non-unstable pc, i hate my server sometimes

tarfeef101 2 tahun lalu
induk
melakukan
1708ea15c3
2 mengubah file dengan 9 tambahan dan 9 penghapusan
  1. 3 3
      Dockerfile
  2. 6 6
      docker-compose.yaml

+ 3 - 3
Dockerfile

@@ -1,16 +1,16 @@
-FROM openjdk:8-alpine
+FROM openjdk:18-alpine
 
 WORKDIR /opt/
 
 ENV MIN_MEM=1 MAX_MEM=16
 
-ARG JAR=https://launcher.mojang.com/v1/objects/bb2b6b1aefcd70dfd1892149ac3a215f6c636b07/server.jar
+ARG VERSION=1.18.1
 
 # download+unpack & move configs to 1 folder
 # this allows for less volumes
 # ty @Roemer for the idea
 RUN apk add curl && \
-    curl -sSL $JAR -o server.jar && \
+    curl -sSL $(curl -sSL https://mcversions.net/download/${VERSION} | grep -o 'https://launcher.mojang.com.*server.jar') -o server.jar && \
     apk del curl && \
     echo "eula=true" > eula.txt && \
     mkdir config && \

+ 6 - 6
docker-compose.yaml

@@ -2,15 +2,15 @@ version: '3'
 
 services:
   minecraft:
-    build: .
-      context:
+    build:
+      context: .
       args:
-        JAR: https://launcher.mojang.com/v1/objects/bb2b6b1aefcd70dfd1892149ac3a215f6c636b07/server.jar
-    image: mc_java_vanilla:alpine-1.15.2
-    container_name: mc_java
+        VERSION: 1.18.1
+    image: tarfeef101/mc_java_vanilla:alpine-1.18.1
+    container_name: mc_javas
     restart: on-failure
     ports:
-      - "8008:25565"
+      - "8009:25565"
     volumes:
       - "./worlds:/opt/worlds"
       - "./config:/opt/config"