Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement (development): Add traefik and mount python files in bf2 container in docker-compose.yml #73

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
version: '2.2'
services:
# Battlefield 2 1.5 server with bf2stats 3.2.0 python scripts
# Battlefield 2 1.5 server with the bf2stats python scripts
bf2:
image: startersclan/docker-bf2:v1.5.3153.0-bf2stats-3.2.0
image: startersclan/docker-bf2:v1.5.3153.0
volumes:
- ./config/bf2/mods/bf2/ai/aidefault-custom.ai:/server/bf2/mods/bf2/ai/aidefault.ai:ro # Customize bots
- ./config/bf2/mods/bf2/settings/serversettings-custom.con:/server/bf2/mods/bf2/settings/serversettings.con:ro # Server config
- ./config/bf2/mods/bf2/settings/maplist-custom-coop.con:/server/bf2/mods/bf2/settings/maplist.con:ro # Maplist (coop)
# - ./config/bf2/mods/bf2/settings/maplist-custom-cq.con:/server/bf2/mods/bf2/settings/maplist.con:ro # Maplist (cq)
- ./src/python:/server/bf2/python # Mount the python files
- ./config/bf2/python/bf2/BF2StatisticsConfig-custom.py:/server/bf2/python/bf2/BF2StatisticsConfig.py:ro # bf2stats python config
ports:
- 16567:16567/udp
Expand Down Expand Up @@ -43,7 +45,27 @@ services:
- gpsp.gamespy.com
- gpcm.gamespy.com
- gamespy.com

# The reverse proxy for our web containers
# This is needed only for the BF2 client BFHQ to work properly (i.e. access the ASP via http://bf2web.gamespy.com)
traefik:
image: traefik:v2.7
volumes:
# Allow traefik to listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- 80:80
networks:
- traefik-public-network
- traefik-network
restart: unless-stopped
command:
- --global.checknewversion=false
- --global.sendanonymoususage=false
# - --log.level=DEBUG
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --entrypoints.web.address=:80

init-container:
image: alpine:latest
Expand Down Expand Up @@ -81,7 +103,7 @@ services:
- DB_USER=root
- DB_PASS=ascent
volumes:
- ./src:/src
- ./src/ASP:/src/ASP
- backups-volume:/src/ASP/system/backups # This volume is effectively unused since ASP doesn't allow DB backups for a remote DB, but mount it anyway to avoid errors.
- cache-volume:/src/ASP/system/cache
- config-volume:/src/ASP/system/config # For a stateful config file
Expand All @@ -91,6 +113,7 @@ services:
- 8081:80
- 9000
networks:
traefik-network:
bf2-network:
aliases:
- bf2web.gamespy.com # Spoof gamespy DNS for the BF2 server connected to this network
Expand Down Expand Up @@ -127,8 +150,11 @@ services:
- bf2-network

networks:
bf2-network:
gamespy-network:
bf2-network:
traefik-public-network:
traefik-network:
internal: true

volumes:
prmasterserver-volume:
Expand Down
5 changes: 5 additions & 0 deletions docs/full-bf2-stack-example/docker-compose.build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# This is a docker compose override file, for production builds with caching for CI environments
services:
bf2:
image: startersclan/docker-bf2:v1.5.3153.0
volumes:
- ../../src/python:/server/bf2/python # Mount the python files

asp:
build:
dockerfile: Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions docs/full-bf2-stack-example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ services:
- DB_HOST=db
- DB_PORT=3306
- DB_NAME=bf2stats
- DB_USER=admin
- DB_PASS=admin
- DB_USER=root
- DB_PASS=ascent
# ports:
# - 8081:80
volumes:
Expand Down