From 4c4456daadcf24e9668221dc47fe67682ce998f1 Mon Sep 17 00:00:00 2001 From: DerTyp7 Date: Fri, 24 Nov 2023 14:50:56 +0100 Subject: [PATCH] Add Docker installation and update CMD command --- Dockerfile | 16 ++++++++++++++-- app/docker-compose.yml | 16 ++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 app/docker-compose.yml diff --git a/Dockerfile b/Dockerfile index 5aadbb4..5211f16 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,19 @@ ENV PORT_IP_MAP "" ENV PYTHONUNBUFFERED=1 # Install Python and pip -RUN apt-get update && apt-get install -y python3 python3-pip python3-venv +RUN apt-get update && apt-get install -y python3 python3-pip python3-venv + +# Install Docker +RUN apt-get update && apt-get install -y \ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg \ + lsb-release && \ + curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \ + echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list && \ + apt-get update && \ + apt-get install -y docker-ce docker-ce-cli containerd.io # Create a virtual environment and activate it RUN python3 -m venv /app/venv @@ -25,4 +37,4 @@ RUN pip install -r requirements.txt EXPOSE 80 # Start Nginx and run the Python app -CMD service nginx start && exec python app.py \ No newline at end of file +CMD docker compose up -d --remove-orphans && service nginx start && exec python app.py \ No newline at end of file diff --git a/app/docker-compose.yml b/app/docker-compose.yml new file mode 100644 index 0000000..47d8287 --- /dev/null +++ b/app/docker-compose.yml @@ -0,0 +1,16 @@ +version: "3.9" + +services: + mc_placeholder_starting: + container_name: mc_placeholder_starting + image: itzg/minecraft-server + ports: + - "20000:20000" + environment: + type: "PAPER" + EULA: "TRUE" + MOTD: "starting..." + MAX_PLAYERS: "0" + MAX_MEMORY: "200M" + SERVER_PORT: "20000" + ONLINE_MODE: "FALSE"