Skip to content

Commit

Permalink
Upgrade the version of postgres used in local development
Browse files Browse the repository at this point in the history
New versions of the postgres docker image require a password, so add one
  • Loading branch information
alastair committed Feb 3, 2025
1 parent 41a5b76 commit 9e5da26
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Below are instructions for setting up a local Freesound installation for develop
# or if the above command does not work, try this one
docker compose run --rm --no-TTY db psql -h db -U freesound -d freesound < freesound-data/db_dev_dump/freesound-small-dev-dump-2023-09.sql

If you a prompted for a password, use `localfreesoundpgpassword`, this is defined in the `docker-compose.yml` file.

10. Update database by running Django migrations

docker compose run --rm web python manage.py migrate
Expand Down
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ services:

# Database server
db:
image: postgres:12.1
image: postgres:16.6
volumes:
- pgdata:/var/lib/postgresql/data
- ./freesound-data/db_dev_dump:/freesound-data/db_dev_dump
env_file:
- environment
ports:
- "${FS_BIND_HOST:-127.0.0.1}:${LOCAL_PORT_PREFIX}5432:5432"
environment:
- POSTGRES_USER=freesound
- POSTGRES_DB=freesound
- POSTGRES_PASSWORD=localfreesoundpgpassword
- FS_USER_ID

# Web worker
Expand Down
2 changes: 1 addition & 1 deletion environment
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DJANGO_DATABASE_URL=postgres://freesound@db/freesound
DJANGO_DATABASE_URL=postgres://freesound:localfreesoundpgpassword@db/freesound

0 comments on commit 9e5da26

Please sign in to comment.