Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #517 Configurable Docker Compose exposed ports #518

Conversation

MaurizioCasciano
Copy link

This PR fixes #517 by allowing the use of environment variables in Docker Compose to configure the exposed ports.

@MaurizioCasciano MaurizioCasciano changed the base branch from master to develop November 15, 2023 10:45
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@seansica seansica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove unnecessary environment variables from persisting in the container. The rest looks okay.

@@ -3,37 +3,44 @@ services:
frontend:
container_name: attack-workbench-frontend
build: .
environment:
FRONTEND_PORT: "${FRONTEND_PORT:-80}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all instances of setting host-centric environment variables from the environment property blocks. I believe this just includes FRONTEND_PORT and BACKEND_PORT. The rest look okay to me (since they are used by the containerized applications).

@ElJocko curious as to your thoughts.

volumes:
- ./docker-compose-resources/nginx/nginx.conf:/etc/nginx/nginx.conf:ro

rest-api:
container_name: attack-workbench-rest-api
build: ../attack-workbench-rest-api
environment:
BACKEND_PORT: "${BACKEND_PORT:-3000}"
Copy link
Contributor

@seansica seansica Feb 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove BACKEND_PORT.

volumes:
- ./docker-compose-resources/nginx/nginx.conf:/etc/nginx/nginx.conf:ro

rest-api:
container_name: attack-workbench-rest-api
build: ../attack-workbench-rest-api
environment:
BACKEND_PORT: "${BACKEND_PORT:-3000}"
DATABASE_PORT: "${DATABASE_PORT:-27017}"
Copy link
Contributor

@seansica seansica Feb 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove BACKEND_PORT and DATABASE_PORT.

Copy link

@Wheeler69 Wheeler69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@seansica
Copy link
Contributor

This compose file has been superseded by the template available in the newer Workbench Deployment repo.

Thank you for your contribution.

@seansica seansica closed this Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REQUEST] Allow to configure Docker Compose exposed ports
5 participants