Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐳 Dockerfile update #60

Merged
merged 4 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ RUN apt-get install -y --no-install-recommends ca-certificates=20190110
RUN apt-get install -y --no-install-recommends git=1:2.20.1-2+deb10u3
# Install 32 bits c++ libraries needed by cod2_lnxded and cross-compilation libs
RUN apt-get install -y --no-install-recommends libstdc++5:i386=1:3.3.6-30
RUN apt-get install -y --no-install-recommends gcc-multilib=4:8.3.0-1
RUN apt-get install -y --no-install-recommends g++-multilib=4:8.3.0-1
# Install mysql & sqlite 32bit libs required if using libcod mysql options
RUN apt-get install -y --no-install-recommends default-libmysqlclient-dev:i386=1.0.5
Expand All @@ -43,12 +42,8 @@ FROM alpine:3.12.0
ARG COD2_VERSION
LABEL maintainer='bgauduch@github'

# setup the server non-root user
ENV SERVER_USER="cod2"
RUN addgroup -S ${SERVER_USER} && adduser -S -D -G ${SERVER_USER} ${SERVER_USER}
USER ${SERVER_USER}

# Copy needed libraries and binaries
ENV SERVER_USER="cod2"
COPY --from=build /usr/lib/i386-linux-gnu/ /usr/lib/i386-linux-gnu/
COPY --from=build /lib/i386-linux-gnu/ /lib/i386-linux-gnu/
COPY --from=build /lib/ld-linux.so.2 /lib/ld-linux.so.2
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ Minimal knowledge in using both is recommended.
1. Edit the config file located in `cod2server/main/server_mp.cfg` to suits your needs:
1. **[MANDATORY] Set the RCON password to something strong and private!**
1. Tweak the rest as you see fit, don't forget to updated the placeholders (server name, admin, etc).
1. [Optional] If you need Punkbuster:
1. *[Optional]* If you need Punkbuster:
1. Activate it by changing `sv_punkbuster` from `0` to `1` in the command arguments of the `docker-compose.yaml`file;
1. Edit the `cod2server/main/punkbuster.cfg` configuration to suits your needs.
1. [Optional] Edit the `bgauduch/cod2server` image tag in `docker-compose.yaml` to choose a different server version;
1. *[Optional]* Edit the `bgauduch/cod2server` image tag in `docker-compose.yaml` to choose a different server version;
1. Depending on your setup, you might have some port-forwarding and firewalling to do in order to make your server publicly available (see required open ports in the `EXPOSE` section of the [Dockerfile](https://github.com/bgauduch/call-of-duty-2-docker-server/blob/master/Dockerfile)).

### Launch the server
Expand Down
15 changes: 9 additions & 6 deletions cod2server/main/server_mp.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// For instance : ./cod2_lnded +set sv_cheats "1"

// list of protected vars:
// set dedicated "2" (0=Listen Server, 1=Dedicated LAN server, 2=Dedicated Internet Server)
// set dedicated "0" (default="0", 0=Listen Server, 1=Dedicated LAN server, 2=Dedicated Internet Server)
// set net_port (default="28960")
// set net_ip xxx.xxx.xxx.xxx (dafault=your host ip)
// set sv_cheats: 0=No, 1=Yes (default="0")
Expand Down Expand Up @@ -49,18 +49,21 @@ set sv_cracked 1
// Show debug info in the log file
set developer "0"

// Pure on or Off: Pure is basicly an anticheat
// Pure is basicly an anticheat
// it checks game files for modification
set sv_pure "1"

// Maximum Players on the Server
set sv_maxclients "20"

// Set the Max Rate Per Player on the server
// MaxRate = Upload Speed / (# of Players * 8)
// follow this rule to fit your upload bandwith:
// MaxRate = (Upload Speed (in bytes/s)) / (nbrs of Players * 8 (for 8bits))
// OR clients * sv_maxrate * 8(for 8bits) = upload speed (in Bytes/s)
set sv_maxrate "25000"

// Server FPS: default=20, range=[10,1000], accepted values=(1000/N) where N is in integer (1000, 500, 333, 250, and so on)
set sv_fps "1000"
// Be aware that increasing this will increase CPU usage
set sv_fps "20"

// Set the Server Min and Max Ping
set sv_maxPing "150"
Expand Down Expand Up @@ -93,7 +96,7 @@ set sv_gamespy "1"
// Allow Downloads from the Server (custom mods and maps): 0=No, 1=Yes
set sv_allowdownload "1"

// Limit client download rate and reconnect attempt limit
// Limit client download rate (bytes/s) and reconnect attempt limit
set sv_dl_maxRate "150000"
set sv_reconnectlimit "3"

Expand Down
2 changes: 1 addition & 1 deletion doc/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,5 @@ There is two types of logs:
* It's the output of the server binary when executed.
* It contains server informations, map rotation, etc.
* The **game** logs:
* It's written by the server bynary to a file, created under `$fs_homepath/main/games_mp.log` by default.
* It's written by the server binary to a file, created under `$fs_homepath/main/games_mp.log` by default.
* It contains all game information (kills, dammages, players join / quit, chat message, etc)
6 changes: 2 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@ services:
- "20510:20510/udp"
- "28960:28960/tcp"
- "28960:28960/udp"
# Mount required game files
volumes:
- ./cod2server/main:/home/cod2/main
# Configure server parameters
command:
[
"+set",
"dedicated",
"2",
"+set",
"net_port",
"28960",
"+set",
"sv_cheat",
"sv_cheats",
"0",
"+set",
"sv_punkbuster",
Expand Down