PostgreSQL
Default Credentials
Section titled “Default Credentials”| Variable | Value |
|---|---|
POSTGRES_USER | postgres |
POSTGRES_PASSWORD | postgres |
Connection
Section titled “Connection”From inside a project container (using the network alias):
psql -h postgres -U postgresFrom the host machine (via the exposed port):
psql -h 127.0.0.1 -p 5432 -U postgresAutomatic DATABASE_URL
Section titled “Automatic DATABASE_URL”When a project’s docker-compose.yml contains a postgres service, dde automatically injects a DATABASE_URL environment variable into the primary service. The database name is derived from the project name (hyphens replaced with underscores).
The variable is only added if:
- It is not already defined in the service’s environment
- It is not defined in the project’s
.envor.env.devfiles
Data Persistence
Section titled “Data Persistence”Data survives container restarts and dde updates. Each version has its own isolated data directory.
Configuration
Section titled “Configuration”Declare in .dde/config.yml:
services: - name: postgresOr with an explicit version:
services: - name: postgres version: "15"See custom-versions.md for details on running non-default versions.