Skip to content

Commit 5bceb74

Browse files
committed
Add network env
1 parent 264519c commit 5bceb74

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/workflows/branch.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ jobs:
8484
- uses: actions/checkout@v4
8585
- name: Set environment variables
8686
run: |
87+
echo "DOCKER_NETWORK_NAME=api-${{ github.ref_name }}" >> $GITHUB_ENV
8788
if [[ "${{ github.ref_name }}" == "alpha" ]]; then
8889
echo "APP_ENV=dev" >> $GITHUB_ENV
8990
echo "DATABASE_URL=mysql://root:symfony@db-branch:3306/symfony" >> $GITHUB_ENV

docker-compose-branch.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
APP_ENV: ${APP_ENV}
99
DATABASE_URL: ${DATABASE_URL}
1010
networks:
11-
- api-${DOCKER_BRANCH}
11+
- ${DOCKER_NETWORK_NAME}
1212
- traefik-realt
1313
# volumes:
1414
# - ./logs/symfony:/var/www/html/var/log:cached
@@ -23,7 +23,7 @@ services:
2323
image: mysql:9.3
2424
container_name: ${DOCKER_BRANCH}-api_php-db
2525
networks:
26-
- api-${DOCKER_BRANCH}
26+
- ${DOCKER_NETWORK_NAME}
2727
environment:
2828
- "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}"
2929
- "MYSQL_USER=${MYSQL_USER}"
@@ -37,7 +37,7 @@ services:
3737
# ports:
3838
# - "6379:6379"
3939
networks:
40-
- api-php
40+
- ${DOCKER_NETWORK_NAME}
4141
restart: unless-stopped
4242
command: ["redis-server", "--appendonly", "yes"]
4343

@@ -47,10 +47,10 @@ services:
4747
ports:
4848
- "18080:8080"
4949
networks:
50-
- api-${DOCKER_BRANCH}
50+
- ${DOCKER_NETWORK_NAME}
5151
restart: always
5252

5353
networks:
54-
api-${DOCKER_BRANCH}:
54+
${DOCKER_NETWORK_NAME}:
5555
traefik-realt:
5656
external: true

0 commit comments

Comments
 (0)