From 6b20579fa259a995e811058a4be89cae00358399 Mon Sep 17 00:00:00 2001 From: Charles Le Maux Date: Tue, 2 Jul 2024 05:56:11 +0100 Subject: [PATCH] [+] Full docker support Signed-off-by: Charles Le Maux --- Dockerfile | 21 ++++++++++++++++++--- docker.sh | 4 ++++ 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 docker.sh diff --git a/Dockerfile b/Dockerfile index b71c967..8745cb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,24 @@ -FROM python:3.12-alpine3.20 +### 1. Linux +FROM alpine:3.20.1 LABEL authors="hapso" - WORKDIR /app COPY . /app -RUN pip install --no-cache-dir -r requirements.txt +### 2. Java +RUN apk update \ +&& apk upgrade \ +&& apk add --no-cache bash \ +&& apk add --no-cache unzip \ +&& apk add --no-cache curl \ +&& apk add --no-cache openjdk21-jre +### 3. Python, PIP +RUN apk add --no-cache python3 \ +&& apk add py3-pip \ +&& pip3 install --no-cache-dir -r requirements.txt --break-system-packages +#### 4. SET JAVA_HOME environment variable (OPTIONAL) +ENV JAVA_HOME="/usr/lib/jvm/java-21-openjdk" +### 5. Launch ! EXPOSE 3000/tcp EXPOSE 3000/udp +EXPOSE 3500-25565/tcp +EXPOSE 3500-25565/udp CMD ["python3", "app.py"] \ No newline at end of file diff --git a/docker.sh b/docker.sh new file mode 100644 index 0000000..e15c101 --- /dev/null +++ b/docker.sh @@ -0,0 +1,4 @@ +docker run -d --restart=unless-stopped -p 3000:3000 -v /home/hapso/Desktop/servii-backend/servers:/app/servers -v /home/hapso/Desktop/servii-backend/users:/app/users servii-backend + +# Add ports using -p : +# Minecraft servers access will be unavailable otherwise