services:
  # Team Fortress 2 server
  teamfortress2_server:
    image: cm2network/tf2:sourcemod-x64
    container_name: teamfortress2_server
    profiles:
      - teamfortress2_server
    restart: on-failure:7
    ports:
     - "27015:27015/tcp"
     - "27015:27015/udp"
    volumes:
      - teamfortress2_data:/home/steam/tf-dedicated
    networks:
      - teamfortress2-network
    env_file:
      - ./env/teamfortress2.env
    environment:
      - TZ=${TZ:-Europe/Paris}
#      - PUID=${PUID:-1000}
#      - PGID=${PGID:-1000}

    security_opt:
      - no-new-privileges:true
    cap_drop:
      - SYS_ADMIN

volumes:
  teamfortress2_data:
    name: teamfortress2_data

networks:
  teamfortress2-network:
    driver: bridge
    name: teamfortress2-network
