This is a custom PostgreSQL Docker image optimized for Azure File Shares (SMB/CIFS) storage in Azure Container Apps.
Azure Files uses the SMB/CIFS protocol which doesn't support Unix file permissions properly. Standard PostgreSQL images fail because:
0700 or 07500777)chmod and chown operations fail silently or error outinitdb checks these permissions and failsThis image includes:
/var/lib/postgresql/data/pgdata)services:
postgres:
image: ghcr.io/dev-halim/postgres-azure:16
environment:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
POSTGRES_DB: mydatabase
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
volumes:
postgres-data:
{
"app_name": "postgres",
"image": "ghcr.io/dev-halim/postgres-azure:16",
"cpu": 0.5,
"memory": "1Gi",
"min_replicas": 1,
"max_replicas": 1,
"ingress_enabled": true,
"external_enabled": false,
"target_port": 5432,
"ingress_transport": "tcp",
"exposed_port": 5432,
"needs_storage": true,
"storage_mount_path": "/var/lib/postgresql/data",
"storage_quota_gb": 20,
"storage_access_mode": "ReadWrite",
"env_vars": {
"POSTGRES_DB": "mydb",
"POSTGRES_USER": "myuser",
"POSTGRES_PASSWORD": "mypassword"
}
}
| Variable | Default | Description |
|---|---|---|
POSTGRES_USER | postgres | PostgreSQL superuser name |
POSTGRES_PASSWORD | (required) | Password for the superuser |
POSTGRES_DB | $POSTGRES_USER | Default database to create |
PGDATA | /var/lib/postgresql/data/pgdata | Data directory path |
postgres:16-alpine imagecd docker/postgres-azure
docker build -t postgres-azure:16 .
docker run -d \
--name postgres-test \
-e POSTGRES_USER=testuser \
-e POSTGRES_PASSWORD=testpass \
-e POSTGRES_DB=testdb \
-p 5432:5432 \
postgres-azure:16
# Test connection
psql -h localhost -U testuser -d testdb
Content type
Image
Digest
sha256:6eac07efd…
Size
19.3 MB
Last updated
5 months ago
docker pull aalhalim/postgres-azure