You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PostgreSQL port 5432 is exposed externally by default in Dify version 1.0.0 due to the configuration in the docker-compose.yaml file, which specifies the port mapping as ${EXPOSE_DB_PORT:-5432}:5432. This means that unless the EXPOSE_DB_PORT environment variable is set to a different value, it defaults to exposing port 5432 externally [1].
To prevent this, you can configure or override the EXPOSE_DB_PORT environment variable by setting it in a .env file or directly in the command line. For example, to avoid exposing the port externally, you can remove the port mapping or set it to a different port that is not exposed externally. Here’s how you can do it:
Using a .env file: Add or modify the following line in your .env file:
EXPOSE_DB_PORT=5433
Using the command line: Run the docker-compose command with the environment variable set:
EXPOSE_DB_PORT=5433 docker-compose up
This will change the external port mapping for the database service, helping to secure your deployment.
Self Checks
Dify version
1.0.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
✔️ Expected Behavior
Only required ports (HTTP or HTTPS) are exposed.
❌ Actual Behavior
The port 5432 of the
db
container has been exposed externally (listening on0.0.0.0
) by default.The text was updated successfully, but these errors were encountered: