diff --git a/config/docker/Dockerfile b/config/docker/Dockerfile index 63dee431..957ad891 100644 --- a/config/docker/Dockerfile +++ b/config/docker/Dockerfile @@ -40,9 +40,9 @@ COPY ./ /home/ubuntu/ballistica WORKDIR /home/ubuntu/ballistica # Compile the application -RUN make cmake-server-build -RUN mkdir ./../ballistica_cmake_server -RUN mv build/cmake/* ./../ballistica_cmake_server +RUN make cmake-server-build \ + && mkdir ./../ballistica_cmake_server \ + && mv build/cmake/* ./../ballistica_cmake_server #-------------------------------RUNNER-------------------------------- # Create a new stage for the runtime environment @@ -65,14 +65,9 @@ LABEL BOMBSQUAD_VERSION=${bombsquad_version} # Install runtime dependencies RUN apt-get update -y && \ apt-get install -y \ - python3.12-venv \ - python3-pip \ - libsdl2-dev \ - libvorbisfile3 \ - freeglut3-dev \ - libopenal1 \ - curl \ - && rm -rf /var/lib/apt/lists/* + python3.12-dev \ + && rm -rf /var/lib/apt/lists/* \ + && python3.12 -c "import uuid;print(uuid.uuid4())">/etc/machine-id # Copy the compiled application from the builder stage COPY --from=builder /home/ubuntu/ballistica_cmake_server/*/staged \ @@ -85,7 +80,6 @@ WORKDIR /home/ubuntu/ballistica # Expose the necessary port EXPOSE 43210/udp -EXPOSE 43210/tcp # Set the default command to run the application -CMD [ "./ballisticakit_server" ] +CMD [ "./ballisticakit_server" ] \ No newline at end of file diff --git a/tools/batools/build.py b/tools/batools/build.py index 876f3e8e..58d27711 100644 --- a/tools/batools/build.py +++ b/tools/batools/build.py @@ -689,10 +689,16 @@ def docker_build() -> None: from batools import version version_num, build_num = version.get_current_version() - _docker_build( - 'bombsquad_server', - '.', - version_num, - build_num, - ) - os.remove('Dockerfile') + image_name = 'bombsquad_server' + try: + print(f'Building docker image {image_name} version {version_num}:{build_num}') + _docker_build( + image_name, + '.', + version_num, + build_num, + ) + except KeyboardInterrupt: + print('Stopping docker image build.') + finally: + os.remove('Dockerfile')