Skip to content

feat: make docker-compose use PORT env variable and .env file#940

Closed
keebOo wants to merge 1 commit into
thedevs-network:mainfrom
keebOo:main
Closed

feat: make docker-compose use PORT env variable and .env file#940
keebOo wants to merge 1 commit into
thedevs-network:mainfrom
keebOo:main

Conversation

@keebOo

@keebOo keebOo commented Oct 7, 2025

Copy link
Copy Markdown

Changes

  • Added env_file: - .env to load environment variables from .env file
  • Changed port mapping from hardcoded 3000:3000 to ${PORT:-3000}:${PORT:-3000}
  • This allows users to customize the port via the PORT environment variable
  • Maintains backward compatibility with default port 3000

Benefits

  • More flexible port configuration
  • Consistent with the existing PORT environment variable support
  • Follows Docker Compose best practices for environment variable usage

- Add env_file: .env to load environment variables
- Use ${PORT:-3000} for port mapping instead of hardcoded 3000
- Maintains backward compatibility with default port 3000
@trgwii

trgwii commented Jun 18, 2026

Copy link
Copy Markdown
Member

This seems like a strange workflow. When I want to use a docker-compose file, I put it in a folder, edit it, and run docker compose up. Is that not a common workflow? Can you link to some Docker documentation on the "best practices" you're referring to?

@poeti8 poeti8 closed this Jul 5, 2026
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.

3 participants