Docker Compose PostgreSQL Version Fix - Preventing Breaking Updates
Following recent updates to our installation procedures, we’ve identified a small improvement that affects Docker Compose users only. This post shows you how to pin PostgreSQL version to avoid potential issues during future updates.
⚠️ Docker Compose Users Only: This fix applies exclusively to users running Sosse with Docker Compose. Other installation methods are not affected.
Installation Procedure Update
We’ve updated our Docker Compose configuration to improve stability during PostgreSQL updates. Previously, our
docker-compose.yml
used postgres:latest
, which could cause compatibility issues during container recreation.
Major PostgreSQL version upgrades can require manual intervention, so these updates should not happen automatically.
The Update: PostgreSQL Version Pinning
We recommend that Docker Compose users apply this simple update to ensure smoother future updates.
Step 1: Check Your Current PostgreSQL Version
Before making changes, verify the current PostgreSQL version running in your container:
$ docker exec -ti sosse_db postgres -V
postgres (PostgreSQL) 17.6 (Debian 17.6-1.pgdg13+1)
Step 2: Update Docker Compose Configuration
Modify your docker-compose.yml
file to specify the exact PostgreSQL version you want to use. Here’s an example change
from latest
to version 17
:
services:
postgres:
- image: postgres:latest
+ image: postgres:17
container_name: sosse_db
environment:
POSTGRES_USER: sosse_user
POSTGRES_PASSWORD: your_password
POSTGRES_DB: sosse_db
Step 3: Apply the Changes
Once you’ve updated the configuration, restart your containers to apply the changes:
$ docker compose down
$ docker compose up --force-recreate -d
The --force-recreate
flag ensures that containers are rebuilt with the new image version.
Conclusion
By pinning the PostgreSQL version in your Docker Compose setup, you can prevent unexpected issues during updates and ensure a more stable environment for your Sosse installation. If you have any questions or need further assistance, feel free to reach out via the GitHub Discussions page