chore: add pgadmin to dev environment

This commit is contained in:
Nicolas Giard 2023-04-25 18:02:34 -04:00 committed by GitHub
parent 732cecf0e9
commit 82d0d42b28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 18 deletions

View file

@ -28,9 +28,6 @@
"ms-playwright.playwright",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.pylint",
"mtxr.sqltools-driver-pg",
"mtxr.sqltools",
"mutantdino.resourcemonitor",
"oderwat.indent-rainbow",
"redhat.vscode-yaml",
@ -63,27 +60,13 @@
"./ietf",
"-p",
"test*.py"
],
"sqltools.connections": [
// Default connection to dev DB container
{
"name": "Local PostgreSQL",
"server": "db",
"port": 5432,
"database": "ietf",
"username": "django",
"password": "RkTkDPFnKpko",
"driver": "PostgreSQL",
"askForPassword": false,
"connectionTimeout": 60
}
]
}
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8000, 5432],
"forwardPorts": [8000, 5432, 5433],
"portsAttributes": {
"3000": {
@ -94,6 +77,10 @@
"label": "PostgreSQL",
"onAutoForward": "silent"
},
"5433": {
"label": "pgAdmin",
"onAutoForward": "silent"
},
"8000": {
"label": "Datatracker",
"onAutoForward": "notify"

View file

@ -15,5 +15,8 @@ services:
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db
pgadmin:
network_mode: service:db
volumes:
datatracker-vscode-ext:

View file

@ -46,6 +46,19 @@ services:
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
pgadmin:
image: dpage/pgadmin4:latest
restart: unless-stopped
environment:
- PGADMIN_DEFAULT_EMAIL=dev@ietf.org
- PGADMIN_DEFAULT_PASSWORD=dev
- PGADMIN_CONFIG_LOGIN_BANNER="Login with dev@ietf.org / dev"
- PGADMIN_LISTEN_PORT=5433
- PGADMIN_DISABLE_POSTFIX=True
- PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False
volumes:
- ./docker/configs/pgadmin-servers.json:/pgadmin4/servers.json
mq:
image: rabbitmq:3-alpine
restart: unless-stopped

View file

@ -0,0 +1,22 @@
{
"Servers": {
"1": {
"Name": "Local Dev",
"Group": "Servers",
"Host": "db",
"Port": 5432,
"MaintenanceDB": "postgres",
"Username": "django",
"UseSSHTunnel": 0,
"TunnelPort": "22",
"TunnelAuthentication": 0,
"KerberosAuthentication": false,
"ConnectionParameters": {
"sslmode": "prefer",
"connect_timeout": 10,
"sslcert": "<STORAGE_DIR>/.postgresql/postgresql.crt",
"sslkey": "<STORAGE_DIR>/.postgresql/postgresql.key"
}
}
}
}

View file

@ -15,6 +15,9 @@ services:
db:
ports:
- '5432'
pgadmin:
ports:
- '5433'
celery:
volumes:
- .:/workspace