Skip to content

Commit

Permalink
Use faster solution, change volume consistency types
Browse files Browse the repository at this point in the history
  • Loading branch information
thena-seer-sfg committed Dec 6, 2024
1 parent 9af689b commit b800802
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ RUN apt-get update -qq \

ARG BASE_RELEASE=bullseye
RUN apt-get update -qq \
&& apt-get install -y gnupg2 wget vim \
&& echo "deb https://apt.postgresql.org/pub/repos/apt ${BASE_RELEASE}-pgdg main" \
> /etc/apt/sources.list.d/pgdg.list \
&& curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc|gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg \
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ touch ~/.netrc #prevents docker compose from creating it as a directory if you d
docker-compose run web bin/rake db:setup

# Run this to get a copy of the Prod database as test data.
# Enter `password` when prompted for a password after the download step.
docker-compose run web script/restore_from_heroku.sh
curl -o ./tmp/shared/latest.dump `heroku pg:backups:url -a commitchange`

docker-compose up

# Enter `password` if prompted for a password.
# This may take up to an hour on Mac.
docker-compose exec db pg_restore --verbose --clean --no-acl --no-owner -h localhost -U admin -d commitchange_development_legacy /tmp/shared/latest.dump
```

Running:
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ services:
ports:
- "5432:5432"
volumes:
- ./tmp/db:/var/lib/postgresql/data
- ./tmp/db:/var/lib/postgresql/data:delegated
- ./tmp/shared:/tmp/shared:cached
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=password
Expand Down

0 comments on commit b800802

Please sign in to comment.