|
| 1 | +# GitHub Copilot Instructions for hlds-docker |
| 2 | + |
| 3 | +## Repository Purpose |
| 4 | + |
| 5 | +This repository provides a Dockerized solution for running the Half-Life Dedicated Server (HLDS), supporting various classic GoldSrc games and mods such as Counter-Strike, Team Fortress Classic, Day of Defeat, and more. The project aims to simplify the setup and management of HLDS servers using Docker, with support for custom configurations, plugins, and mods. |
| 6 | + |
| 7 | +## Key Features |
| 8 | + |
| 9 | +- Pre-built Docker images for multiple GoldSrc games and mods. |
| 10 | +- Support for custom server configurations and plugins. |
| 11 | +- Ability to build and run custom mods. |
| 12 | +- Compatibility with both modern and legacy versions of HLDS. |
| 13 | +- Automated workflows for building, validating, and publishing Docker images. |
| 14 | + |
| 15 | +## Technologies Used |
| 16 | + |
| 17 | +- **Docker**: For containerizing the HLDS server. |
| 18 | +- **Docker Compose**: For managing multi-container setups and simplifying server configuration. |
| 19 | +- **GitHub Actions**: For CI/CD workflows, including building, validating, and publishing Docker images. |
| 20 | +- **Shell Scripting**: For managing server startup and configuration (`entrypoint.sh`). |
| 21 | +- **SteamCMD**: For downloading and managing HLDS game files. |
| 22 | + |
| 23 | +## Helpful Context for Copilot |
| 24 | + |
| 25 | +1. **Dockerfile**: |
| 26 | + |
| 27 | + - The `Dockerfile` is located in the `container` directory and is used to build the HLDS server image. |
| 28 | + - It supports build arguments such as `GAME`, `FLAG`, `VERSION`, and `IMAGE` to customize the build process. |
| 29 | + |
| 30 | +2. **Entrypoint Script**: |
| 31 | + |
| 32 | + - The `entrypoint.sh` script is responsible for initializing the server, copying configuration files, and starting the HLDS server with the specified game and arguments. |
| 33 | + |
| 34 | +3. **Configuration Files**: |
| 35 | + |
| 36 | + - The `config` directory contains server configuration files (e.g., `server.cfg`, `motd.txt`) that are copied into the container during the build process or mounted as volumes at runtime. |
| 37 | + |
| 38 | +4. **Mods Directory**: |
| 39 | + |
| 40 | + - The `mods` directory is used for custom mods and plugins. Files in this directory are copied into the container or mounted as volumes. |
| 41 | + |
| 42 | +5. **Workflows**: |
| 43 | + |
| 44 | + - The repository includes GitHub Actions workflows for: |
| 45 | + - Validating Docker images (`validate.yml`). |
| 46 | + - Publishing beta images (`beta.yml`). |
| 47 | + - Publishing production images (`publish.yml`). |
| 48 | + |
| 49 | +6. **Supported Games**: |
| 50 | + |
| 51 | + - The repository supports multiple GoldSrc games, including: |
| 52 | + - `valve` (Half-Life Deathmatch) |
| 53 | + - `cstrike` (Counter-Strike) |
| 54 | + - `czero` (Counter-Strike Condition Zero) |
| 55 | + - `dod` (Day of Defeat) |
| 56 | + - `tfc` (Team Fortress Classic) |
| 57 | + - `dmc` (Deathmatch Classic) |
| 58 | + - `gearbox` (Half-Life Opposing Force) |
| 59 | + - `ricochet` (Ricochet) |
| 60 | + |
| 61 | +7. **Volume Mapping**: |
| 62 | + |
| 63 | + - The `docker-compose.yml` and `docker run` commands use volume mappings to allow users to provide custom configurations and mods at runtime. |
| 64 | + |
| 65 | +8. **Validation**: |
| 66 | + - The `validate.yml` workflow ensures that the Docker image is functional by running the container and validating directory mappings and game data. |
| 67 | + |
| 68 | +## Suggestions for Copilot |
| 69 | + |
| 70 | +- Assist with writing or modifying Dockerfiles, shell scripts, and GitHub Actions workflows. |
| 71 | +- Provide suggestions for managing environment variables and build arguments. |
| 72 | +- Help with debugging volume mappings and container runtime issues. |
| 73 | +- Generate documentation for supported games, configuration options, and usage examples. |
| 74 | +- Suggest improvements to CI/CD workflows, such as caching or parallelizing steps. |
| 75 | + |
| 76 | +## Additional Notes |
| 77 | + |
| 78 | +- The repository adheres to best practices for Docker image creation, including multi-stage builds and minimal base images. |
| 79 | +- Contributions should align with the project's scope, focusing on ease of use, extensibility, and legal compliance with Valve's licensing terms. |
0 commit comments