Soren90 / cs2-docker

Dockerized cs2 server
MIT License
34 stars 5 forks source link

Multiple server instances #1

Closed xe1os closed 1 year ago

xe1os commented 1 year ago

Hi,

How to have multiple server instances running?

Thanks

Soren90 commented 1 year ago

There is two ways. Either you just copy the Docker compose file to another folder and then change the port or you can do it like this:

version: "3.7"

volumes:
  cs2-data:
    name: cs2-data
  cs2-data2:
    name: cs2-data2

services:
  csgo:
    image: soren90/cs2
    container_name: cs2-ds

    environment:
      SERVER_HOSTNAME: "Counter-strike 2 Dedicated server"
      SERVER_PASSWORD: 
      RCON_PASSWORD: 
      IP: 0.0.0.0
      PORT: 27015
      GAME_TYPE: 0
      GAME_MODE: 1
      MAP: de_inferno
      MAXPLAYERS: 12
      USER:
      PASSWORD:

    volumes:
      - type: volume
        source: cs2-data
        target: /mnt/server

    network_mode: "host"

    restart: unless-stopped
    stdin_open: true
    tty: true
 csgo2:
    image: soren90/cs2
    container_name: cs2-ds2

    environment:
      SERVER_HOSTNAME: "Counter-strike 2 Dedicated server"
      SERVER_PASSWORD: 
      RCON_PASSWORD: 
      IP: 0.0.0.0
      PORT: 27016
      GAME_TYPE: 0
      GAME_MODE: 1
      MAP: de_inferno
      MAXPLAYERS: 12
      USER:
      PASSWORD:

    volumes:
      - type: volume
        source: cs2-data2
        target: /mnt/server

    network_mode: "host"

    restart: unless-stopped
    stdin_open: true
    tty: true
  rconpanel:
    image: soren90/rcon-panel
    ports:
      - "3000:3000"
    restart: unless-stopped

Sorry if there is an error here. I don't have a computer available at the moment