From 9ad6f0ad900bf8aede7bd8901a3046f2c443fdee Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Sat, 26 Nov 2022 16:30:11 +0100 Subject: [PATCH] Update env files Signed-off-by: Bensuperpc --- Makefile | 2 +- docker-compose.yml | 27 ++++++++++++++++----------- env/flask_database.env | 4 ++++ env/flask_website.env | 7 +++++++ env/pgadmin.env | 3 +++ 5 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 env/flask_database.env create mode 100644 env/flask_website.env create mode 100644 env/pgadmin.env diff --git a/Makefile b/Makefile index a9fd51e..4d98bdb 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ DOCKER := docker -PROFILE := wp_db wordpress webserver certbot phpmyadmin flask_website flask_db qbittorrent +PROFILE := wp_db wordpress webserver certbot phpmyadmin flask_website flask_db pgadmin qbittorrent PROFILE_CMD := $(addprefix --profile ,$(PROFILE)) COMPOSE_FILE := docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml index 6635d95..95744bc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -59,12 +59,8 @@ services: - flask_db volumes: - ./bensuperpc_website:/app:rw - environment: - FLASK_DEBUG: "${FLASK_DEBUG:-1}" - POSTGRES_URL: "${POSTGRES_URL:-flask_db:5432}" - POSTGRES_USER: "${POSTGRES_USER:-postgres}" - POSTGRES_PW: "${POSTGRES_PW:-postgres}" - POSTGRES_DB: "${POSTGRES_DB:-website}" + env_file: + - env/flask_website.env restart: unless-stopped ports: - 5000:5000 @@ -76,11 +72,8 @@ services: profiles: - flask_db restart: unless-stopped - environment: - POSTGRES_HOST_AUTH_METHOD: "${POSTGRES_HOST_AUTH_METHOD:-trust}" - POSTGRES_USER: "${POSTGRES_USER:-postgres}" - POSTGRES_PASSWORD: "${POSTGRES_PW:-postgres}" - POSTGRES_DB: "${POSTGRES_DB:-website}" + env_file: + - env/flask_database.env # ports: # - 5432:5432 volumes: @@ -132,6 +125,18 @@ services: - wp_db networks: - app-network + pgadmin: + container_name: pgadmin_container + image: dpage/pgadmin4:6.16 + profiles: + - pgadmin + restart: unless-stopped + env_file: + - env/pgadmin.env + depends_on: + - flask_db + networks: + - app-network volumes: certbot-etc: name: certbot-etc diff --git a/env/flask_database.env b/env/flask_database.env new file mode 100644 index 0000000..cd3fc23 --- /dev/null +++ b/env/flask_database.env @@ -0,0 +1,4 @@ +POSTGRES_HOST_AUTH_METHOD=trust +POSTGRES_USER=bensuperpc +POSTGRES_PASSWORD=nPRh270dKH3hz%6HS2$X%8F3fqoQ*Fex +POSTGRES_DB=website \ No newline at end of file diff --git a/env/flask_website.env b/env/flask_website.env new file mode 100644 index 0000000..e46bb3a --- /dev/null +++ b/env/flask_website.env @@ -0,0 +1,7 @@ +FLASK_DEBUG=1 + +# Acces to the database +POSTGRES_URL=flask_db:5432 +POSTGRES_USER=bensuperpc +POSTGRES_PW=nPRh270dKH3hz%6HS2$X%8F3fqoQ*Fex +POSTGRES_DB=website diff --git a/env/pgadmin.env b/env/pgadmin.env new file mode 100644 index 0000000..0efd111 --- /dev/null +++ b/env/pgadmin.env @@ -0,0 +1,3 @@ +PGADMIN_DEFAULT_EMAIL=bensuperpc@bensuperpc.org +PGADMIN_DEFAULT_PASSWORD=LmRVf9DY291ez7B^^%2RntHcsCrJ5fQ! +#PGADMIN_ENABLE_TLS