Skip to content

Commit

Permalink
Enhancement: Use bf2-network network in docker-compose.yml
Browse files Browse the repository at this point in the history
This allows other projects e.g. `bf2sclone` to connect to `db` via the `bf2-network` docker network.
  • Loading branch information
leojonathanoh committed Sep 30, 2022
1 parent bb833b7 commit 623b3ba
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
11 changes: 6 additions & 5 deletions docker-compose.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ services:
ports:
- 80:80
networks:
- default
- bf2-network
depends_on:
- init-container
- php
Expand All @@ -66,7 +66,7 @@ services:
- logs-volume:/src/ASP/system/logs
- snapshots-volume:/src/ASP/system/snapshots
networks:
- default
- bf2-network
depends_on:
- init-container
restart: unless-stopped
Expand All @@ -81,7 +81,7 @@ services:
volumes:
- db-volume:/var/lib/mysql
networks:
- default
- bf2-network
depends_on:
- init-container
restart: unless-stopped
Expand All @@ -94,11 +94,12 @@ services:
ports:
- 8080:80
networks:
- default
- bf2-network
restart: unless-stopped

networks:
default:
bf2-network:
name: bf2-network

volumes:
backups-volume:
Expand Down
6 changes: 5 additions & 1 deletion docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
http://nginx/ASP/getplayerinfo.aspx 200
http://nginx/ASP/system 403
networks:
- default
- bf2-network
entrypoint:
- /bin/sh
command:
Expand All @@ -33,3 +33,7 @@ services:
exit 1
fi
done
networks:
bf2-network:
name: bf2-network
11 changes: 6 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ services:
ports:
- 80:80
networks:
- default
- bf2-network
depends_on:
- init-container
- php
Expand All @@ -73,7 +73,7 @@ services:
- logs-volume:/src/ASP/system/logs
- snapshots-volume:/src/ASP/system/snapshots
networks:
- default
- bf2-network
extra_hosts:
# For xdebug to reach the host via `host.docker.internal`. See: https://github.com/moby/moby/pull/40007#issuecomment-578729356 and https://stackoverflow.com/questions/49907308/installing-xdebug-in-docker
# If xdebug does not work, you may need to add an iptables rule to the INPUT chain: iptables -A INPUT -i br+ -j ACCEPT
Expand All @@ -91,7 +91,7 @@ services:
volumes:
- db-volume:/var/lib/mysql
networks:
- default
- bf2-network
depends_on:
- init-container

Expand All @@ -102,10 +102,11 @@ services:
ports:
- 8080:80
networks:
- default
- bf2-network

networks:
default:
bf2-network:
name: bf2-network

volumes:
backups-volume:
Expand Down

0 comments on commit 623b3ba

Please sign in to comment.