Skip to content

Commit

Permalink
fix: 🐛 Add default server command for game
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Jun 13, 2024
1 parent 47dfd4f commit 7f65e7b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 14 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ COPY --chown=steam:steam config $GAME

RUN chmod +x ./entrypoint.sh

ENTRYPOINT ["./entrypoint.sh", "-timeout 6"]
ENTRYPOINT ["./entrypoint.sh", "-timeout 6"]

CMD ["-game", "${GAME}"]
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
# Half-Life Dedicated Server Docker
# Half-Life Dedicated Server With Docker

Initializes a Half-Life Dedicated Server.
Creates a Half-Life Dedicated Server instance using Docker. You can configure the server client however you'd like, and for any official games that are supported by the GoldSrc Dedicated Server client.

## Setp
## Setup

1. Define the mod you wish to build.
Ensure you have the [Docker daemon installed and running](https://www.docker.com/).

```bash
export MOD=cstrike
> [!IMPORTANT]
> The following steps will not work if you're using a system running on ARM or Mac Silicone architecture.
1. Define the game you want to start the server for, and set it in the `GAME` section of `docker-compose.yml`.

```yml
services:
hlds:
environment:
game: "cstrike"
```
2. Build the image
> [!IMPORTANT]
> Possible options include Half-Life Deathmatch (`valve`), Counter-Strike (`cstrike`), Counter-Strike Condition Zero (`czero`), Deathmatch Classic (`dmc`), Opposing Force (`gearbox`), Ricochet (`ricochet`), Day of Defeat (`dod`), and Team Fortress Classic (`tfc`).

2. Build the image.

```sh
docker compose build
```

3. Start the image
3. Start the image.

```sh
docker compose up
```

## Configs
## Server Configuration

If you wish to define server configurations, such as addons, motd, server configs, etc, add them to the `config` directory. These will be volume mapped into the container on startup.
If you wish to define server configurations, such as addons, plugins, custom message of the days, map rotations, etc, you can add them to the `config` directory. These will be copied into the container on startup of your server.
3 changes: 3 additions & 0 deletions config/default.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
// Defines the default configuration for the server
// This file is executed automatically when the server starts
// Docs: https://developer.valvesoftware.com/

hostname "The Coffee House"
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ services:
- "./config:/config"
ports:
- "27015:27015/udp"
command: -game ${GAME} +maxplayers 12 +map cs_italy +rcon_password "replace_me" +log on
network_mode: "host"
command: -game ${GAME} +maxplayers 12 +map cs_italy +log on
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ fi

echo Starting Half-Life Dedicated Server...

./hlds_run "-game ${GAME} $@"
./hlds_run "$@"

0 comments on commit 7f65e7b

Please sign in to comment.