Skip to content

Commit

Permalink
local-dev: add pgadmin4 container
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Zmeskal <[email protected]>
  • Loading branch information
Jan Zmeskal authored and ldelossa committed Oct 19, 2020
1 parent dc4bda4 commit 15b607a
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Documentation/howto/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ localhost:5433 --- Quay's Postgres DB
username: quay
database: quay
localhost:8081 --- Postgres GUI (pgadmin4)
Login:
username: [email protected]
password: clair
localhost:8082 --- OpenAPI Swagger Editor.
You can view ClairV4's public API here.
Expand Down
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ local-dev-up: vendor
$(docker-compose) up -d activemq
$(docker-compose) up -d clair-db
$(docker) exec -it clair-db bash -c 'while ! pg_isready; do echo "waiting for postgres"; sleep 2; done'
$(docker-compose) up -d pgadmin
$(docker-compose) up -d indexer
$(docker-compose) up -d matcher
$(docker-compose) up -d notifier
Expand All @@ -55,6 +56,7 @@ local-dev-up-with-quay: vendor
$(docker-compose) up -d activemq
$(docker-compose) up -d clair-db
$(docker) exec -it clair-db bash -c 'while ! pg_isready; do echo "waiting for clair postgres"; sleep 2; done'
$(docker-compose) up -d pgadmin
$(docker-compose) up -d indexer-quay
$(docker-compose) up -d matcher
$(docker-compose) up -d notifier
Expand Down Expand Up @@ -125,10 +127,17 @@ local-dev-matcher-restart:
local-dev-notifier-restart:
$(docker-compose) up -d --force-recreate notifier

# restart all clair instances
.PHONY: local-dev-clair-restart
local-dev-clair-restart:
$(docker-compose) up -d --force-recreate indexer
$(docker-compose) up -d --force-recreate matcher
$(docker-compose) up -d --force-recreate notifier

# restart the local development rabbitmq
.PHONY: local-dev-notifier-restart
.PHONY: local-dev-rabbitmq-restart
local-dev-rabbitmq-restart:
$(docker-compose) up -d --force-recreate notifier
$(docker-compose) up -d --force-recreate rabbitmq

# restart the local development swagger-ui, any local code changes will take effect
.PHONY: local-dev-swagger-ui-restart
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ services:
retries: 3
start_period: 10s

pgadmin:
container_name: pgadmin
image: dpage/pgadmin4:latest
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: clair
PGADMIN_SERVER_JSON_FILE: /pgadmin4/config/servers.json
PGADMIN_LISTEN_PORT: 8081
ports:
- "8081:8081"
volumes:
- "./local-dev/pgadmin:/pgadmin4/config"
depends_on:
- clair-db

traefik:
container_name: clair-traefik
image: traefik:v2.2
Expand Down
2 changes: 2 additions & 0 deletions local-dev/pgadmin/passfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# hostname:port:database:username:password
clair-db:5432:clair-db:clair:clair
14 changes: 14 additions & 0 deletions local-dev/pgadmin/servers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Servers": {
"1": {
"Name": "clair-db",
"Group": "Servers",
"Port": 5432,
"Username": "clair",
"Host": "clair-db",
"SSLMode": "disable",
"MaintenanceDB": "postgres",
"PassFile": "/pgadmin4/config/passfile.txt"
}
}
}

0 comments on commit 15b607a

Please sign in to comment.