Skip to content

Commit e27d5a7

Browse files
committed
Add and remove external network Frontend
1 parent e8f2ba6 commit e27d5a7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Taskfile.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ tasks:
2727
cmds:
2828
- task _show_preinstall_notes
2929
- echo "Installing"
30+
- |
31+
# Check if the external network 'frontend' exists, create if not
32+
if ! docker network ls --format '{{.Name}}' | grep -wq frontend; then
33+
echo "Creating external network 'frontend'"
34+
docker network create frontend
35+
else
36+
echo "External network 'frontend' already exists"
37+
fi
3038
- docker compose --env-file .env.local --env-file .env.docker.local -f docker-compose.yml pull
3139
- docker compose --env-file .env.local --env-file .env.docker.local -f docker-compose.yml up --force-recreate --detach --remove-orphans
3240
- echo "Waiting for database to be ready"
@@ -63,6 +71,14 @@ tasks:
6371
- stop
6472
cmds:
6573
- docker compose --env-file .env.local --env-file .env.docker.local -f docker-compose.yml down --volumes --remove-orphans
74+
- |
75+
# Check if the external network 'frontend' exists, remove if it does
76+
if docker network ls --format '{{.Name}}' | grep -wq frontend; then
77+
echo "Removing external network 'frontend'"
78+
docker network rm frontend
79+
else
80+
echo "External network 'frontend' does not exist"
81+
fi
6682
6783
up:
6884
desc: Take the environment up without altering the existing state of the containers

0 commit comments

Comments
 (0)