From c40d66ba46b62bc98610060f10ab4c3adfcafeff Mon Sep 17 00:00:00 2001 From: Kirill Date: Mon, 5 May 2025 14:43:48 +0300 Subject: [PATCH] add pgadmin --- .env | 5 ++++- .gitignore | 1 + docker-compose.yaml | 23 +++++++++++++++++++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 86dbd05..65c72fe 100644 --- a/.env +++ b/.env @@ -1,3 +1,6 @@ POSTGRES_USER=myuser POSTGRES_PASSWORD=mypassword -POSTGRES_DB=mydb \ No newline at end of file +POSTGRES_DB=mydb +PGADMIN_DEFAULT_PASSWORD=qwerty +PGADMIN_PORT=8085 +WEB_PORT=8080 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 28f4438..14f51da 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +pgadmin .idea postgres_data # ---> Python diff --git a/docker-compose.yaml b/docker-compose.yaml index 13da89c..1766bf6 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,8 +3,8 @@ services: image: postgres:15-alpine env_file: - ./.env - ports: - - "5432:5432" +# ports: +# - "5432:5432" volumes: - ./postgres_data:/var/lib/postgresql/data container_name: postgres_db @@ -17,7 +17,7 @@ services: start_period: 80s web: ports: - - "80:8086" + - ${WEB_PORT:-5050}:8086 build: context: ./src env_file: @@ -25,4 +25,19 @@ services: depends_on: db: condition: service_healthy - restart: always \ No newline at end of file + restart: always + + pgadmin: + container_name: pgadmin_container + image: dpage/pgadmin4:6.19 + depends_on: + db: + condition: service_healthy + environment: + PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin@example.com} + PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin} + PGADMIN_CONFIG_SERVER_MODE: 'False' + volumes: + - ./pgadmin:/var/lib/pgadmin + ports: + - ${PGADMIN_PORT:-5050}:80 \ No newline at end of file