mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-06 23:59:18 +08:00
i promise this is very cool
This commit is contained in:
parent
0c54e7a99d
commit
a89b94f090
60
Dockerfile
60
Dockerfile
@ -1,13 +1,10 @@
|
|||||||
FROM ubuntu:24.04
|
# Start with the base image
|
||||||
|
FROM ubuntu:24.04 AS builder
|
||||||
|
|
||||||
ENV LANG en_US.utf8
|
ENV LANG en_US.utf8
|
||||||
|
|
||||||
ENV LANGUAGE=en_US
|
ENV LANGUAGE=en_US
|
||||||
|
|
||||||
COPY ./ /home/ubuntu/ballistica
|
# Install build dependencies
|
||||||
|
|
||||||
WORKDIR /home/ubuntu/ballistica
|
|
||||||
|
|
||||||
RUN DEBIAN_FRONTEND=noninteractive \
|
RUN DEBIAN_FRONTEND=noninteractive \
|
||||||
apt-get update -y && \
|
apt-get update -y && \
|
||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
@ -25,20 +22,47 @@ RUN DEBIAN_FRONTEND=noninteractive \
|
|||||||
cmake \
|
cmake \
|
||||||
libvorbis-dev
|
libvorbis-dev
|
||||||
|
|
||||||
ARG BOMBSQUAD_VERSION=N/A
|
# Copy source code
|
||||||
|
COPY ./ /home/ubuntu/ballistica
|
||||||
|
|
||||||
|
WORKDIR /home/ubuntu/ballistica
|
||||||
|
|
||||||
|
# Compile the application
|
||||||
|
RUN ./do_stuff
|
||||||
|
|
||||||
|
# Optionally, clean up the build dependencies and any temporary files to reduce image size
|
||||||
|
# This step depends on how './do_stuff compile' works and if it generates any temporary files
|
||||||
|
RUN apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/*
|
||||||
|
|
||||||
|
# Create a new stage for the runtime environment
|
||||||
|
FROM ubuntu:24.04
|
||||||
|
|
||||||
|
ENV LANG en_US.utf8
|
||||||
|
ENV LANGUAGE=en_US
|
||||||
|
|
||||||
|
WORKDIR /home/ubuntu/ballistica
|
||||||
|
|
||||||
|
# Install runtime dependencies
|
||||||
|
RUN DEBIAN_FRONTEND=noninteractive \
|
||||||
|
apt-get update -y && \
|
||||||
|
apt-get install -y \
|
||||||
|
python3.12-venv \
|
||||||
|
python3-pip \
|
||||||
|
libsdl2-dev \
|
||||||
|
libvorbisfile3 \
|
||||||
|
freeglut3-dev \
|
||||||
|
libopenal1 \
|
||||||
|
curl
|
||||||
|
|
||||||
|
# Copy the compiled application from the builder stage
|
||||||
|
COPY --from=builder /home/ubuntu/ballistica/build/cmake/server-debug/staged/ /home/ubuntu/ballistica
|
||||||
|
|
||||||
|
ARG BOMBSQUAD_VERSION=N/A
|
||||||
LABEL bombsquad_version=${BOMBSQUAD_VERSION}
|
LABEL bombsquad_version=${BOMBSQUAD_VERSION}
|
||||||
|
|
||||||
CMD [ "./do_stuff" ]
|
# Expose the necessary port
|
||||||
|
|
||||||
# ENTRYPOINT ["./do_stuff"]
|
|
||||||
|
|
||||||
# CMD [ "make" ]
|
|
||||||
|
|
||||||
# this does not port forward locally
|
|
||||||
# its just a hint for user which port to forward
|
|
||||||
EXPOSE 43210/udp
|
EXPOSE 43210/udp
|
||||||
|
|
||||||
# Clean up
|
# Set the default command to run the application
|
||||||
# RUN apt-get clean && \
|
CMD [ "./ballisticakit_server" ]
|
||||||
# rm -rf /var/lib/apt/lists/* /tmp/*
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user