Ch0wW / docker-hlds-won2

A docker container that creates a WON2 Half-Life / Counter-Strike 1.5 server using HLDS 1.1.1.0.
https://ch0ww.fr
9 stars 1 forks source link

docker-hlds-won2

ko-fi

This project generates a Docker image that automates setting up a Half-Life dedicated server, version 1.1.1.0, using the WON2 protocol. This docker image also includes several popular mods that are still played using this version which are Counter-Strike 1.5, 1.3, 1.1, 1.0, Beta 7.1, Team Fortress Classic, and Deathmatch Classic.

Related projects


Requirements

Why this docker ?

There are a few communities around the World that still play Counter-Strike 1.5 or other classic mods of Half-Life. However, I have noticed that some Linux distributions are not friendly with this version of HLDS due to potential library incompatibilities, and may instantly crash upon starting.

A workaround was found since then, but I still wanted to provide a ready to use image for preservation purposes. Since Docker allows creating "sandboxed" environments using other versions of Linux, I created this project.

Features

Included mods

Installation/Usage

Simply edit the docker-compose.yml, or copy it to docker-compose.override.yml to add or modify anything you require.

If you need to change the port of your server, change all occurences of 27015 (= in ports and in the command sections) to the desired port of your choice.

version: "3.0"

services:
  hlds:
    build: .
    image: "hlds1110"
    restart: always
    volumes:
      - ./config/cstrike:/server/hlds_l/cstrike 
      - ./config/cstrk10r:/server/hlds_l/cstrk10r
      - ./config/cstrk11r:/server/hlds_l/cstrk11r
      - ./config/cstrk13:/server/hlds_l/cstrk13 
      - ./config/cstrk71:/server/hlds_l/cstrk71
      - ./config/dmc:/server/hlds_l/dmc 
      - ./config/tfc:/server/hlds_l/tfc
    ports:
      - 27015:27015
      - 27015:27015/udp
    command:
      - -port 27015 -game cstrike +map de_dust2 +maxplayers 16
    security_opt:
      - no-new-privileges:true

Once done, just execute docker compose up to make sure everything works as intended, and you should be good to go. Change also the user token so that it is checking with the user and group running the container, to avoid upload issues or potential permission problems.

In case you need to rebuild the image, just type docker compose build and you should be good to go.

Important information !

If you desire to host a Counter-Strike Beta 7.1, 1.0, 1.1, 1.3, there will be a command you will be required to add at the end of your command subsection:

+localinfo mm_gamedll "dlls/cs_i386.so"

Example with a Counter-Strike 1.3 server:

version: "3.0"

services:
  hlds:
    image: "hlds1110"
    restart: always
    volumes:
      - ./config/cstrk13:/server/hlds_l/cstrk13 
    ports:
      - 27015:27015
      - 27015:27015/udp
    command:
      - -port 27015 -game cstrk13 +map de_dust2 +maxplayers 16 +localinfo mm_gamedll "dlls/cs_i386.so"
    security_opt:
      - no-new-privileges:1

Customizing your server configuration

Simply go to the config folder, and modify the required folders you wish.

Am I required to set "sv_lan" to "1"?

Nope! It's already included inside the modified hlds_run script, so you don't have to!


This project uses files copyrighted by VALVe.