Skip to content

[Regression] Cannot work on multiple projects on the same computer, external amazeeio-network is added to all php containers. #94

@silverham

Description

@silverham

PROBLEM

Hi Team, due to commit:

[ https://github.com/govCMS/scaffold commit ]

commit 95f75ddeb846df17c24addeac4fb064491c6f6c5
Merge: f5e50f0 5f315bf
Author: Steve Worley <sj.worley88@gmail.com>
Date:   Mon Nov 27 16:00:55 2023 +1100

Merge pull request #72 from govCMS/fix/compose-network-stanzas
Fix: Add missing network stanzas.

Commit: 5f315bf
PR: #72

[ Per project GovCMS SaaS commit ]

Author: GovCMS service account <govhosting@finance.gov.au>
Date:   Wed Jul 17 11:39:27 2024 +0000

[skip ci] GovCMS Service: Upgrade platform scaffold.

When you multiple GovCMS projects running, the nginx docker container will connect to any projects' php container, as all projects have access to each others php container via the external amazeeio-network network. So then local development is broken. Previously this issue didn't exist because the amazeeio-network network only existed on the nginx container.

Additionally, local development override for oembed is now broken, so if the internet goes down, local development of firewalled GovCMS instances cannot function. e.g.

$config['media.settings']['oembed_providers_url'] = 'http://nginx:8080/themes/custom/my_theme/assets/json/providers.json';

@see here nginx connects to php container (which the hostname is not unique per network), where it should connects over default network which is per project so issues.

fastcgi_pass ${NGINX_FASTCGI_PASS:-php}:9000;

https://github.com/uselagoon/lagoon-images/blob/main/images/nginx-drupal/drupal.conf#L78

I propose to revert this commit.

WHAT SHOULD OF BEEN DONE INSTEAD for mailhog etc.

These services should be defined in a docker-compose.override.yml file and use the default network so no conflicts.

WORKAROUND

Option 1)
FOR ALL PROJECTS - revert the commit by commenting out the - amazeeio-network line except for nginix.

OLD:

networks:
  - amazeeio-network
  - default

NEW:

networks:
#  - amazeeio-network
  - default

Then docker-compose up -d on all projects.

Option 2)

Create a new separate network e.g. amazeeio-network-additional.

Run: docker network create amazeeio-network-additional

Attach the pygmy reverse proxy to the new network

docker network connect amazeeio-network-additional amazeeio-haproxy

Then per project, comment out the - amazeeio-network line and add the - amazeeio-network-additional line.

OLD:

networks:
  - amazeeio-network
  - default

NEW:

networks:
#  - amazeeio-network
  - amazeeio-network-additional
  - default

And same with the external network definition at the bottom of the docker-compose.yml` file.

OLD:

networks:
#  amazeeio-network:
#     external: true
  amazeeio-network-additional:
    external: true

Then docker-compose up -d on that project.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions