Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch PostgreSQL container to use pgautoupgrade #4892

Merged
merged 5 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .woodpecker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ steps:

services:
database:
image: postgres:16-alpine
image: pgautoupgrade/pgautoupgrade:16-alpine
environment:
POSTGRES_USER: lemmy
POSTGRES_PASSWORD: password
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ services:
logging: *default-logging

postgres:
image: postgres:16-alpine
image: pgautoupgrade/pgautoupgrade:16-alpine
# this needs to match the database host in lemmy.hson
# Tune your settings via
# https://pgtune.leopard.in.ua/#/
Expand Down
2 changes: 1 addition & 1 deletion docker/federation/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ x-lemmy-default: &lemmy-default
restart: always

x-postgres-default: &postgres-default
image: postgres:16-alpine
image: pgautoupgrade/pgautoupgrade:16-alpine
environment:
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD=password
Expand Down
2 changes: 1 addition & 1 deletion scripts/postgres_12_to_15_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ echo "Removing the old postgres folder"
sudo rm -rf volumes/postgres

echo "Updating docker-compose to use postgres version 15."
sed -i "s/image: postgres:.*/image: postgres:15-alpine/" ./docker-compose.yml
sudo sed -i "s/image: .*postgres:.*/image: pgautoupgrade\/pgautoupgrade:15-alpine/" ./docker-compose.yml

echo "Starting up new postgres..."
sudo docker-compose up -d postgres
Expand Down
2 changes: 1 addition & 1 deletion scripts/postgres_15_to_16_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ echo "Removing the old postgres folder"
sudo rm -rf volumes/postgres

echo "Updating docker compose to use postgres version 16."
sudo sed -i "s/image: .*postgres:.*/image: docker.io\/postgres:16-alpine/" ./docker-compose.yml
sudo sed -i "s/image: .*postgres:.*/image: pgautoupgrade\/pgautoupgrade:16-alpine/" ./docker-compose.yml

echo "Starting up new postgres..."
sudo docker compose up -d postgres
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @ticoombs mentioned, these migration scripts arent needed anymore. However they are still linked in Lemmy release announcements, so I would leave them in but remove everything except for this line:
sudo sed -i "s/image: .*postgres:.*/image: pgautoupgrade\/pgautoupgrade:16-alpine/" ./docker-compose.yml

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Expand Down