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 to docker-compose stack #2172

Merged
merged 4 commits into from
May 4, 2021
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ src/core/settings.py
/src/media/django-summernote
/src/media/*
/src/collected-static
/db/*

mydatabase
node_modules/
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ ifndef DB_VENDOR
DB_VENDOR=postgres
endif

# Exposed ports
JANEWAY_PORT ?= 8000
PGADMIN_PORT ?= 8001

unexport NO_DEPS
DB_NAME ?= janeway
DB_NAME ?= janeway
DB_HOST=janeway-postgres
DB_PORT=5432
DB_USER=janeway-web
Expand Down Expand Up @@ -46,7 +51,9 @@ export DB_PORT
export DB_NAME
export DB_USER
export DB_PASSWORD
SUFFIX ?= $(shell python -c "from time import time; print(hex(int(time()*10000000))[2:])")
export JANEWAY_PORT
export PGADMIN_PORT
SUFFIX ?= $(shell date +%s)
SUFFIX := ${SUFFIX}
DATE := `date +"%y-%m-%d"`

Expand Down
4 changes: 4 additions & 0 deletions db/pgadmin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
*/
!servers.json
!.gitignore
20 changes: 20 additions & 0 deletions db/pgadmin/servers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"Servers": {
"1": {
"Name": "janeway-web",
"Group": "Servers",
"Host": "janeway-postgres",
"Port": 5432,
"MaintenanceDB": "postgres",
"Username": "janeway-web",
"SSLMode": "prefer",
"SSLCert": "<STORAGE_DIR>/.postgresql/postgresql.crt",
"SSLKey": "<STORAGE_DIR>/.postgresql/postgresql.key",
"SSLCompression": 0,
"Timeout": 10,
"UseSSHTunnel": 0,
"TunnelPort": "22",
"TunnelAuthentication": 0
}
}
}
22 changes: 21 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@ services:
- "POSTGRES_PASSWORD=${DB_PASSWORD}"
- "POSTGRES_USER=${DB_USER}"
- "POSTGRES_DB=${DB_NAME}"
depends_on:
- janeway-pgadmin

janeway-pgadmin:
image: dpage/pgadmin4
user: root
ports:
- target: 80
published: "${PGADMIN_PORT}"
volumes:
- ./db/pgadmin:/var/lib/pgadmin
environment:
- [email protected]
- "PGADMIN_DEFAULT_PASSWORD=${DB_PASSWORD}"
- PG_ADMIN_LISTEN_ADDRESS=0.0.0.0
- GUNICORN_THREADS=2
- PGADMIN_SERVER_JSON_FILE=/var/lib/pgadmin/servers.json
- PGADMIN_CONFIG_SERVER_MODE=False
- PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False

janeway-mysql:
image: mysql:5.7
Expand Down Expand Up @@ -53,7 +72,8 @@ services:
- ./logs:/vol/janeway/logs
- ./db/janeway.sqlite3:/db/janeway.sqlite3
ports:
- "8000:8000"
- target: 8000
published: "${JANEWAY_PORT}"
environment:
- DB_VENDOR
- DB_HOST
Expand Down