-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (29 loc) · 1.55 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Use the slim version of Python 3.11 as the base image
FROM python:3.11-slim
# Image label indicating the source of the Dockerfile
LABEL org.opencontainers.image.source=https://github.com/wasinuddy/montainer
# Set the working directory inside the container to /app
WORKDIR /app
# Install dependencies required for downloading and executing the Minecraft Bedrock server
RUN apt-get update && apt-get install -y wget unzip libcurl4 && apt-get clean && rm -rf /var/lib/apt/lists/*
# Define a build argument for specifying the architecture (default is amd64)
ARG ARCH="linux/amd64"
# Install QEMU if the ARCH is not linux/amd64
RUN if [ "${ARCH}" != "linux/amd64" ]; then apt-get update && apt-get install -y qemu-user qemu-user-static binfmt-support && apt-get clean && rm -rf /var/lib/apt/lists/*; fi
# Remove Cache and unnecessary packages
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy the requirements.txt file into the container and install Python dependencies
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
# Expose ports for the Minecraft server and the web application
EXPOSE 19132/udp
EXPOSE 8000
# Create a directory for the web UI and copy the backend files into it
RUN mkdir web
COPY web/backend web
# Copy the Minecraft server files into the container
COPY minecraft_server /app/minecraft_server
# Create a directory to host configuration files
RUN mkdir /app/configs
# Set the entry point for the container, using the architecture specified by the build argument
ENTRYPOINT [ "python3", "web/main.py", "--arch", "${ARCH}"]