-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
169 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Build Docker Image | ||
on: | ||
push: | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: jives/hlds:cstrike |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Docs: https://developer.valvesoftware.com/wiki/SteamCMD | ||
|
||
# Use the latest version of Ubuntu as the base image | ||
FROM ubuntu:latest | ||
|
||
# Define variables for the username, volume directory, and game | ||
ENV USERNAME=steam | ||
ENV CONFIG_DIR=src | ||
ENV INSTALL_DIR=hlds | ||
ENV MOD=cstrike | ||
|
||
# Update the package list and install the necessary packages | ||
RUN dpkg --add-architecture i386 && \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends curl file libc6:i386 lib32stdc++6 ca-certificates rsync && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Create a user for the SteamCMD and game | ||
RUN groupadd -r $USERNAME && \ | ||
useradd -r -g $USERNAME -m -d /opt/$USERNAME $USERNAME | ||
|
||
# Create a directory for the game using the CONFIG_DIR variable | ||
RUN mkdir /$CONFIG_DIR | ||
USER $USERNAME | ||
WORKDIR /opt/$USERNAME | ||
|
||
# Copy the hlds.txt file to the container | ||
COPY ./hlds.txt /opt/$USERNAME | ||
|
||
# Download and install SteamCMD | ||
RUN curl -v -sL media.steampowered.com/client/installer/steamcmd_linux.tar.gz | tar xzvf - && \ | ||
file /opt/$USERNAME/linux32/steamcmd && \ | ||
./steamcmd.sh +force_install_dir ./$INSTALL_DIR +app_set_config 90 mod $MOD +runscript hlds.txt | ||
|
||
# Create a symbolic link to the Steam SDK | ||
RUN mkdir -p $HOME/.steam && \ | ||
ln -s /opt/$USERNAME/linux32 $HOME/.steam/sdk32 && \ | ||
echo 70 > /opt/$USERNAME/$INSTALL_DIR/steam_appid.txt | ||
|
||
# Expose the necessary ports for the game | ||
WORKDIR /opt/$USERNAME/$INSTALL_DIR | ||
|
||
|
||
# Copy configs, Metamod, Stripper2 and AMX. | ||
COPY --chown=steam:steam $CONFIG_DIR $MOD | ||
COPY --chown=steam:steam ./entrypoint.sh ./entrypoint.sh | ||
|
||
# Add execute permissions to the entrypoint.sh script | ||
RUN chmod +x ./entrypoint.sh | ||
|
||
EXPOSE 27015 | ||
EXPOSE 27015/udp | ||
|
||
# Start server. | ||
ENTRYPOINT ["./entrypoint.sh", "-timeout 3"] | ||
|
||
# Default start parameters. | ||
CMD ["+maxplayers 12", "+map cs_italy"] | ||
|
||
RUN ls $MOD -la | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# hlds-docker | ||
# hlds-dockerr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: "3.7" | ||
|
||
services: | ||
hlds: | ||
build: docker | ||
image: jives/hlds:cstrike | ||
volumes: | ||
- "./src:/tmp/src" | ||
command: +maxplayers 12 +map cs_italy +rcon_password "supersecret" +log on +logaddress 0.0.0.0 27500 | ||
network_mode: "host" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env sh | ||
|
||
if [ -d /tmp/$CONFIG_DIR ] | ||
then | ||
rsync --chown=steam:steam /tmp/$CONFIG_DIR/* /opt/steam/$INSTALL_DIR/$MOD | ||
fi | ||
|
||
echo Starting server... | ||
|
||
./hlds_linux "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@ShutdownOnFailedCommand 0 | ||
@NoPromptForPassword 1 | ||
login anonymous | ||
app_update 90 | ||
app_update 90 validate | ||
app_update 90 validate | ||
quit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Add server configurations to default.cfg | ||
exec default.cfg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// For almost full list of server comamnds visit: | ||
// http://sr-team.clan.su/K_stat/hlcommandsfull.html | ||
|
||
// This sets the config file which is loaded at each map change. | ||
hostname "Counter-Strike Server" | ||
|
||
mp_autocrosshair "0" | ||
mp_falldamage "0" | ||
mp_logdetail "1" | ||
mp_logfile "0" | ||
mp_timelimit "120" | ||
pausable "0" | ||
secure "1" | ||
sv_aim "0" | ||
sv_allowupload "0" | ||
sv_contact "jives.dev" | ||
sv_proxies "0" | ||
sv_region "3" | ||
sv_minrate "1000" | ||
sv_maxrate "100000" | ||
sv_minupaterate "60" | ||
sv_maxupaterate "101" | ||
sv_password "test" | ||
|
||
// voice | ||
sv_alltalk "1" | ||
sv_voicecodec voice_speex | ||
sv_voiceenable "1" | ||
sv_voicequality "3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
game "Counter-Strike" | ||
url_info "www.counter-strike.net" | ||
url_dl "" | ||
version "1.6" | ||
size "184000000" | ||
svonly "0" | ||
secure "1" | ||
type "multiplayer_only" | ||
cldll "1" | ||
hlversion "1111" | ||
nomodels "1" | ||
nohimodel "1" | ||
mpentity "info_player_start" | ||
//gamedll "dlls\mp.dll" | ||
//gamedll_linux "dlls/cs.so" | ||
//gamedll_osx "dlls/cs.dylib" | ||
trainmap "tr_1" | ||
gamedll "addons\metamod\dlls\metamod.dll" | ||
gamedll_linux "addons/metamod/dlls/metamod.so" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cs_italy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Test MOTD | ||
https://jives.dev |