diff --git a/README.md b/README.md index 014c2cc..08d6687 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,21 @@ that the server should block from being allowed to be used. If a line has an IP followed by a comma and the word public (`1.2.3.4,public` for example), then it will allow the IP to be used for private groups, but not present any of the public groups to that user. +# USAGE WITH DOCKER + +A Dockerfile is available for building the docker container image. + +Building the container image: + + git clone https://github.com/essej/aooserver.git + cd aooserver/docker + docker build . -t aooserver + +Using the container image: + + docker run -p 10998:10998/udp -p 10998:10998 aooserver + +How to run with flags: `docker run -p PORT:PORT/udp -p PORT:PORT aooserver aooserver [flags]` # SOURCE NOTES diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..4330431 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,25 @@ +## Building is done in a separate container +FROM debian:12 as builder +## Install dependencies +RUN apt-get update && apt-get install -y git make bash g++ curl libcurl4-openssl-dev pkg-config + +## Clone the repository to build the source +WORKDIR /app +RUN git clone --recursive https://github.com/essej/aooserver.git + +## Build the release +WORKDIR /app/aooserver/Builds/LinuxMakefile +RUN bash -c "CONFIG=Release make" + + +## Actual end container containing our service +FROM debian:12-slim +## Install dependencies +RUN apt-get update && apt-get install -y curl +## Copy our build from the build container +COPY --from=builder /app/aooserver/Builds/LinuxMakefile/build/aooserver /usr/bin/aooserver +## Add port exposure +EXPOSE 10998/udp +EXPOSE 10998/tcp +## Default command +CMD aooserver