add pgadmin

This commit is contained in:
2025-05-05 14:43:48 +03:00
parent 4a031f473c
commit c40d66ba46
3 changed files with 24 additions and 5 deletions

3
.env
View File

@@ -1,3 +1,6 @@
POSTGRES_USER=myuser
POSTGRES_PASSWORD=mypassword
POSTGRES_DB=mydb
PGADMIN_DEFAULT_PASSWORD=qwerty
PGADMIN_PORT=8085
WEB_PORT=8080

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
pgadmin
.idea
postgres_data
# ---> Python

View File

@@ -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:
@@ -26,3 +26,18 @@ services:
db:
condition: service_healthy
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