专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像 官方专业版轩辕镜像 官方专业版官方专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 1072982923

startersclan/bf2stats Docker 镜像 - 轩辕镜像

bf2stats
startersclan/bf2stats
BF2Statistics 2.0 🎖 Private ranking system for EA's BF2. Dockerized 🐳
1 收藏0 次下载
🚀 稳定镜像源 = 更少宕机 + 更低运维成本
镜像简介版本下载
🚀 稳定镜像源 = 更少宕机 + 更低运维成本

bf2stats

![github-actions]([] ![github-release]([] ![docker-image-size]([] ![docker-image-size]([]

BF2Statistics 2.x.x with docker support.

Although BF2Statistics 3.1.0 has been released, it is not backward compatible with <= 2.x.x. Hence, this project is to help those who want to retain their 2.x.x stats system, and to ease deployment of the stack since support is scarce. It runs on PHP 7.4 with nginx.

Usage (docker)

asp image (for support environment variables, see here):

sh
docker run --rm -it -p 80:80 -e DB_HOST=db -e DB_PORT=3306 -e DB_NAME=bf2stats -e DB_USER=admin -e DB_PASS=admin startersclan/bf2stats:2.9.4-asp

bf2sclone image (for supported environment variables, see here):

sh
docker run --rm -it -p 80:80 -e DBIP=db -e DBNAME=bf2stats -e DBLOGIN=admin -e DBPASSWORD=admin startersclan/bf2stats:2.9.4-bf2sclone

See this example showing how to deploy Battlefield 2 1.5 server, PRMasterserver as the master server, and bf2stats as the stats web server, using docker-compose.

See this example showing how to deploy Battlefield 2 1.5 server, with BF2Hub as the master server and bf2stats as the stats web server, using docker-compose.

Upgrading (docker)
  • For upgrades between v2.2.0 and v2.5.x: Bump the docker image tags, login to the ASP and click follow the instructions to upgrade the DB
  • For <= v2.5.x, see instructions to upgrade to v2.6.x here
  • For upgrades between v2.6.0 and above: Bump the docker image tags, login to the ASP and click follow the instructions to upgrade the DB

Development

To use Docker Compose v2, use docker compose instead of docker-compose.

sh
# 1. Start
docker-compose up --build
# ASP available at http://localhost:8081/ASP. Username: admin, password admin. Login and set up the DB the first time. See ./config/ASP/config.php
# bf2sclone available at http://localhost:8082
# phpmyadmin available at http://localhost:8083. Username: admin, password: admin. See ./config/ASP/config.php config file

# 2. If you have just setup the DB the first time, restart the BF2 server to begin recording stats
docker-compose restart bf2

# 3. Before launching the BF2 client, spoof gamespy DNS by adding these entries in C:\Windows\system32\drivers\etc\hosts. This is needed for the BF2 client to work correctly.
# Replace '192.168.1.100' with your development machine's IP address
192.168.1.100 battlefield2.available.gamespy.com
192.168.1.100 battlefield2.master.gamespy.com
192.168.1.100 battlefield2.ms14.gamespy.com
192.168.1.100 master.gamespy.com
192.168.1.100 motd.gamespy.com
192.168.1.100 gpsp.gamespy.com
192.168.1.100 gpcm.gamespy.com
192.168.1.100 gamespy.com
192.168.1.100 bf2web.gamespy.com
192.168.1.100 gamestats.gamespy.com
192.168.1.100 eapusher.dice.se

# 4. Launch BF2 client and connect to the BF2 server
# - To use BF2Hub as the Gamespy server, launch BF2.exe, and login to your BF2Hub account, and connect to the BF2 server using MULTIPLAYER > CONNECT TO IP
# - To use PRMasterserver in docker-compose as the Gamespy server, if you have previously patched BF2.exe using the BF2Hub patcher, you must unpatch BF2.exe. Then launch BF2.exe (do not use BF2Hub), create a new Online account, login, and connect to the BF2 server using MULTIPLAYER > CONNECT TO IP.
# At the end of a round, the BF2 server will send a stats snapshot to the ASP. View stats in ASP and bf2sclone.

# Development - Install vscode extensions
# Once installed, set breakpoints in code, and press F5 to start debugging.
code --install-extension bmewburn.vscode-intelephense-client # PHP intellisense
code --install-extension xdebug.php-debug # PHP remote debugging via xdebug
code --install-extension ms-python.python # Python intellisense
# If xdebug is not working, iptables INPUT chain may be set to DROP on the docker bridge.
# Execute this to allow php to reach the host machine via the docker0 bridge
sudo iptables -A INPUT -i br+ -j ACCEPT

# BF2 server - Restart server
docker-compose restart bf2
# BF2 server - Attach to the bf2 server console
docker attach $( docker-compose ps -q bf2 )
# BF2 server - Exec into container
docker exec -it $( docker-compose ps -q bf2) bash
# BF2 server - Read logs
docker exec -it $( docker-compose ps -q bf2 ) bash -c 'cat python/bf2/logs/bf2game_*'
# BF2 server - List snapshots
docker exec -it $( docker-compose ps -q bf2 ) ls -alR python/bf2/logs/snapshots/unsent

# asp - Exec into container
docker exec -it $( docker-compose ps -q asp ) sh
# asp - List backups
docker exec -it $( docker-compose ps -q asp ) ls -al /src/ASP/system/database/backups
# asp - List config
docker exec -it $( docker-compose ps -q asp ) ls -al /src/ASP/system/config
# asp - Read logs
docker exec -it $( docker-compose ps -q asp ) ls -al /src/ASP/system/logs
# asp - List snapshots
docker exec -it $( docker-compose ps -q asp ) ls -alR /src/ASP/system/snapshots

# Test
./test/test.sh dev 1

# Test production builds 1
./test/test.sh prod1 1

# Test production builds 2
./test/test.sh prod2 1

# Test a snapshot
curl -s -A GameSpyHTTP/1.0 -H 'Content-Type: application/json' --data @test/snapshots/-test-snapshot.txt localhost:8081/ASP/bf2statistics.php

# Dump the DB
docker exec $( docker-compose ps -q db ) mysqldump -uroot -padmin bf2stats | gzip > bf2stats.sql.gz

# Restore the DB
zcat bf2stats.sql.gz | docker exec -i $( docker-compose ps -q db ) mysql -uroot -padmin bf2stats

# Stop
docker-compose down

# Cleanup
docker-compose down --remove-orphans
docker volume rm bf2stats_prmasterserver-volume
docker volume rm bf2stats_backups-volume
docker volume rm bf2stats_config-volume
docker volume rm bf2stats_logs-volume
docker volume rm bf2stats_snapshots-volume
docker volume rm bf2stats_bf2sclone-cache-volume
docker volume rm bf2stats_db-volume

Release

sh
./release.sh 2.x.x
git add .
git commit -m "Chore: Release 2.x.x"

FAQ

Q: ASP installer never completes the first time

A: This is caused by a bug where the UI fails to handle an invalid response from the backend. A PHP_ERROR Warning: file_put_contents(/src/ASP/system/config/config.php): failed to open stream: Permission denied in /src/ASP/system/core/Config.php on line 165 is output before the JSON response causing invalid JSON.

Grant PHP write permission for config.php.

sh
chmod 666 ./config/ASP/config.php
docker-compose restart asp
Q: Warning: file_put_contents(/src/ASP/system/config/config.php): failed to open stream: Permission denied in /src/ASP/system/core/Config.php on line 165 appearing in ASP dashboard

A: Grant the PHP user write permission for ./src/ASP/system/config/config.php.

Q: There was an error testing the system. Please refresh the page and try again. when using System > Test System in ASP

A: This is means the UI received an invalid JSON response from the backend. If you know how to, you can examine the payload of the POST response.

Q: BF2Statistics Processing Check: Fail or Gamespy (.aspx) Basic Response: Fail or Gamespy (.aspx) Advanced (1) Response: Fail when using System > Test System in ASP

A: DNS resolution problem. The HOST used in the test to test those Gamespy endpoints is the same host you see in your browser. For instance, if you are accessing the ASP using [***], ASP runs tests against [***], which will may fail if DNS resolution for yourdomain.com fails.

If you see this in a development environment, simply ignore the errors. There is an integration test to those endpoints to ensure they work.

If you are seeing this in a production environment, use a fully qualified domain name (FQDN) so that ASP can resolve to its external DNS name to test against its external web endpoint.

Q: Importing Logs Failed! when using Server Admin > Import Logs in ASP

A: Same as this

Q: Table (army) *NOT* Backed Up: [1045] Access denied for user 'admin'@'%' (using password: YES) when using System > Backup Database in ASP

A: The db user does not have the FILE privilege. Add a grant manually. But note that even if you did, you still won't be able to backup without major security issues. See here.

Q: Table (army) *NOT* Backed Up: [1] Can't create/write to file when using System > Backup Database in ASP

The backupdb module uses SELECT * INTO OUTFILE, but the src files are not in the db container, mariadb cannot find the path to export the files. In the past, the apache, php and mysql ran on the same machine with write access to the same filesystem, but with docker, each container has its own filesystem. The only workaround is to mount the backups-volume inside the db container at the same path as it is mounted in the ASP container /src/ASP/system/database/backups/, with write permissions for php's user 82 and mariadb's user 999 which menas the directory needs 777 permissions (world writeable), which is very bad from the point of view of security.

It is better to backup the DB on a cron schedule using mysqldump from another container linked to the db container:

sh
# Dump a DB at host `db`, user `root`, password `admin`, database `bf2stats`
mysqldump -hdb -uroot -padmin bf2stats
Q: Xdebug: [Step Debug] Could not connect to debugging client. Tried: host.docker.internal:9000 (through xdebug.client_host/xdebug.client_port) appears in PHP logs on docker-compose up

A: If you are seeing this in development, the PHP debugger is not running. Press F5 in vscode to start the PHP debugger. If you don't need debugging, set XDEBUG_MODE=off in docker-compose.yml to disable XDebug.

查看更多 bf2stats 相关镜像 →
startersclan/docker-bf2 logo
startersclan/docker-bf2
Dockerized Battlefield 2 server 🐳
10K+ pulls
上次更新:未知

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

登录仓库拉取

通过 Docker 登录认证访问私有仓库

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

Docker Compose

Docker Compose 项目配置

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

MacOS OrbStack

MacOS OrbStack 容器配置

宝塔面板

在宝塔面板一键配置镜像

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

极空间

极空间 NAS 系统配置服务

爱快路由

爱快 iKuai 路由系统配置

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

专属域名拉取

无需登录使用专属域名

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

轩辕镜像免费版与专业版有什么区别?

免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。

轩辕镜像支持哪些镜像仓库?

专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。

流量耗尽错误提示

当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。

410 错误问题

通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。

manifest unknown 错误

先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。

镜像拉取成功后,如何去掉轩辕镜像域名前缀?

使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
startersclan/bf2stats
官方博客Docker 镜像使用技巧与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
咨询镜像拉取问题请 提交工单,官方技术交流群:1072982923
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
咨询镜像拉取问题请提交工单,官方技术交流群:
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
官方邮箱:点击复制邮箱
©2024-2026 源码跳动
官方邮箱:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.