Skip to content

Commit 5778b78

Browse files
committed
i have added the network name "backend" connected all of the instances to it now the containerers are able to talk to each other.
Best practice you can also add a frontend network and connect the frontend applications to the frontend network so both networks are separated.
1 parent 8a5fe87 commit 5778b78

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

development/docker-compose.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ services:
1818
WORDPRESS_DB_PASSWORD: "${DB_ROOT_PASSWORD}"
1919
depends_on:
2020
- db
21-
22-
links:
23-
- db
24-
21+
networks:
22+
- backend
2523
wpcli:
2624
image: wordpress:cli
2725
container_name: cc-base-wp-cli
@@ -36,9 +34,8 @@ services:
3634
depends_on:
3735
- db
3836
- wp
39-
links:
40-
- db:db
41-
37+
networks:
38+
- backend
4239
pma:
4340
image: phpmyadmin/phpmyadmin
4441
container_name: cc-base-phpmyadmin
@@ -49,9 +46,8 @@ services:
4946
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
5047
ports:
5148
- ${IP}:8080:80
52-
links:
53-
- db:db
54-
49+
networks:
50+
- backend
5551
db:
5652
build:
5753
context: ./bin/${DATABASE} #change db if required in .env file
@@ -65,6 +61,8 @@ services:
6561
MYSQL_DATABASE: "${DB_NAME}"
6662
MYSQL_USER: root
6763
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
64+
networks:
65+
- backend
6866

6967
composer:
7068
image: composer/composer
@@ -79,3 +77,8 @@ services:
7977

8078
volumes:
8179
db_data:
80+
81+
82+
networks:
83+
backend:
84+

0 commit comments

Comments
 (0)