From f480d855602b91342702b0f7e880da25e68c6b40 Mon Sep 17 00:00:00 2001 From: Daniel afx Date: Sun, 6 Feb 2022 03:18:30 +0200 Subject: [PATCH] install pgadmin --- .env.prod-sample | 7 ++++--- .gitignore | 5 +++-- data/dbadmin/.placeholder | 0 docker-compose.yml | 28 ++++++++++++++++++++-------- lb/haproxy.cfg | 6 ++++-- 5 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 data/dbadmin/.placeholder diff --git a/.env.prod-sample b/.env.prod-sample index 48e9c8a..6a4ce67 100644 --- a/.env.prod-sample +++ b/.env.prod-sample @@ -9,15 +9,16 @@ SQL_HOST=db SQL_PORT=5432 DATABASE=postgres +DATABASE_URL=postgresql://forest:forest123@db:5432/forest_prod POSTGRES_USER=forest POSTGRES_PASSWORD=forest123 POSTGRES_DB=forest_prod - -DATABASE_URL=postgresql://forest:forest123@db:5432/forest_prod +PGADMIN_DEFAULT_EMAIL: daniel@deflax.net +PGADMIN_DEFAULT_PASSWORD: Kasd18913Sx +PGADMIN_CONFIG_SERVER_MODE: 'False' MAIL_ADMIN=daniel@deflax.net MAIL_SUBJECT_PREFIX=ForestNet - MAIL_SERVER=smtp.gmail.com MAIL_USERNAME=admin@gmail.com MAIL_PASSWORD=kur diff --git a/.gitignore b/.gitignore index 0cf872c..929e9d1 100644 --- a/.gitignore +++ b/.gitignore @@ -21,11 +21,12 @@ logs/certbot/* # ignore generated certificates for haproxy data/certificates/* -# ignore flask postgresql volume +# ignore postgresql volumes data/db/* !data/db/.placeholder +data/dbadmin/* +!data/dbadmin/.placeholder # ignore osmtile postgresql volume data/osmtile/* !data/osmtile/.placeholder - diff --git a/data/dbadmin/.placeholder b/data/dbadmin/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml index f0e5e2e..d710f2f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,6 +33,26 @@ services: - meta.role=certbot #entrypoint: sh -c 'while true; do sleep 1; done' entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 15d & wait $${!}; done;'" + db: + image: postgres:13-alpine + volumes: + - "./data/db/pgdata:/var/lib/postgresql/data/" + env_file: + - ./.env.prod + restart: always + networks: + - internal + pgadmin: + image: dpage/pgadmin4 + volumes: + - "./data/dbadmin:/var/lib/pgadmin" + env_file: + - ./.env.prod + restart: always + networks: + - internal + depends_on: + - db flask: build: context: ./flask @@ -46,14 +66,6 @@ services: - internal depends_on: - db - db: - image: postgres:13-alpine - volumes: - - "./data/db/pgdata:/var/lib/postgresql/data/" - env_file: - - ./.env.prod - networks: - - internal osmtile: image: "overv/openstreetmap-tile-server:latest" hostname: osmtile diff --git a/lb/haproxy.cfg b/lb/haproxy.cfg index 0ff0172..9a6d0b2 100644 --- a/lb/haproxy.cfg +++ b/lb/haproxy.cfg @@ -70,7 +70,9 @@ backend forest.deflax.net # server list server s1 flask:5000 check +backend db.forest.deflax.net + server s1 pgadmin:80 check + #backend docs.deflax.net # # server list -# server s1 swagger:80 check - +# server s1 swagger:80 check \ No newline at end of file