Skip to content

Commit

Permalink
Merge pull request #73 from startersclan/enhancement/development-add-…
Browse files Browse the repository at this point in the history
…traefik-and-mount-python-files-in-bf2-container-in-docker-compose.yml

Enhancement (development): Add `traefik` and mount `python` files in `bf2` container in `docker-compose.yml`
  • Loading branch information
leojonathanoh authored Nov 22, 2023
2 parents 8994d31 + c02408a commit db066fa
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
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

0 comments on commit db066fa

Please sign in to comment.