kaimallea / csgo

A containerized dedicated server for Counter-Strike: Global Offensive
The Unlicense
242 stars 58 forks source link

Cant connect to server created with docker-compose #41

Open Henroks opened 4 years ago

Henroks commented 4 years ago

This is my docker-compose.yml:

version: "3"
networks:
  csgo:
    external: true

services:
    dedicated:
        networks:
          - default
          - csgo
        image: kmallea/csgo
        privileged: true
        ports:
          - "27015:27015/tcp"
          - "27015:27015/udp"
          - "27020:27020/tcp"
          - "27020:27020/udp"
        volumes:
          - ./:/home/steam/csgo
        environment:
            STEAM_ACCOUNT: TOKEN
            SERVER_PASSWORD: hehe
            SERVER_HOSTNAME: asdasd
            RCON_PASSWORD: pw123
            IP: 0.0.0.0
            PORT: 27015
            LAN: 1
        tty: true

I can see it in Local Network (LAN) in csgo, but cant connect, any idea?

0BuRner commented 4 years ago

Any logs in the container or in the CSGO console?

Henroks commented 4 years ago

Only this: image

0BuRner commented 4 years ago

Is this the logs after you tried to connect in the game? Did you try to connect from local network computer with public IP mentioned in the logs? And with local IP?

Henroks commented 4 years ago

Nothing is mentioned in the logs. Tried to connect with my local network ip, container ip, 127.0.0.1 and public ip (same as in the logs), still nothing in the logs.

kaimallea commented 4 years ago

@Henroks did you ever get this working? Your config is telling the container to join an existing network named csgo. How is that network accessible?

I would try using the host network configuration if possible. See this example here: https://github.com/kaimallea/csgo/blob/master/docker-compose.yaml#L38

danieliser commented 3 years ago

@kaimallea I'm seeing similar issue and have tried all combinations of network configurations, port forwards etc.

Strangely I got it working one time, but didn't set my steam ID in SOURCEMOD_ADMINS, restarted it to do that and haven't been able to get back in for 2 days now.

Tried these combinations

network_mode: "host"
    network_mode: "host"
    ports:
      - "27015:27015/tcp"
      - "27015:27015/udp"
      - "27020:27020/tcp"
      - "27020:27020/udp"
    ports:
      - "27015:27015/tcp"
      - "27015:27015/udp"
      - "27020:27020/tcp"
      - "27020:27020/udp"
networks:
  csgo:

    networks:
      - csgo

    ports:
      - "27015:27015/tcp"
      - "27015:27015/udp"
      - "27020:27020/tcp"
      - "27020:27020/udp"

Pretty sure the one that I magically had working was the second with just ports defined, but many restarts, rebuilds later, no luck.

Not sure what I'm doing wrong here, especially given I see the game in Lan server browser, but it shows Not responding, and if I manually try to connect to 0.0.0.0 or 0.0.0.0:27015 or 127.0.0.1 or my public IP etc nothing works.

The one time it did work these things were absolutely true:

I'm using Docker for Windows and use containers regularly with localhost ports auto forwarded usually.

In this case I've even forwarded incoming & outgoing ports for UDP & TCP as well though I didn't think it should matter locally.

danieliser commented 3 years ago

Also should add, the server logs never show a connection attempt and if I manually try to connect it just shows retrying...

The one time I got it the server logs came alive.

whopavan commented 3 years ago

@danieliser I'll try creating a new server this weekend and update. The last time I created it was working all fine (on Linux server)

ghost commented 3 years ago

may help.may not: im using the host setup without assigning ports on a debian server, LAN env variable disabled but port env to 27015 and tv_port to 27020 on an exposed host router setup. works as long as steam does not release an update,then i have to restart the server.