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

Add pgadmin for easy local database access #558

Merged
merged 4 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions config/db-pgadmin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Servers": {
"1": {
"Name": "mampf-postgres",
"Group": "Servers",
"Host": "db",
"Port": 5432,
"MaintenanceDB": "mampf",
"Username": "mampf"
}
}
}
20 changes: 20 additions & 0 deletions docker/development/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ services:
source: db-data
target: /var/lib/postgresql/data

pgadmin:
image: dpage/pgadmin4
ports:
- "5050:80"
environment:
PGADMIN_DEFAULT_EMAIL: admin@mampf.edu
PGADMIN_DEFAULT_PASSWORD: pgmampf
volumes:
- pgadmin:/var/lib/pgadmin
# Pre-load server definition into pgAdmin (so that no manual setup via
# the web interface is required). See "pgadmin4/servers.json" here:
# -> https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html#mapped-files-and-directories
# -> https://forums.docker.com/t/automatically-connect-pgadmin-to-a-postgresql-volume-on-which-there-is-a-database-and-automatically-load-a-schema-present-on-a-sql-file-with-docker-compose/124647/2
- type: bind
source: ../../config/db-pgadmin.json
target: /pgadmin4/servers.json

mailcatcher:
restart: on-failure:10
image: dockage/mailcatcher:latest
Expand All @@ -56,6 +73,8 @@ services:
image: mampf:development
environment:
RAILS_ENV: docker_development
# If you change these variables, make sure to adapt accordingly in
# config/db-pgadmin-config.json
DEVELOPMENT_DATABASE_ADAPTER: postgresql
DEVELOPMENT_DATABASE_DATABASE: mampf
DEVELOPMENT_DATABASE_INTERACTIONS: interactions
Expand Down Expand Up @@ -164,5 +183,6 @@ volumes:
submissions:
public:
db-data:
pgadmin:
solr-data:
sprockets-cache:
Loading