Skip to content

Commit 82d0d42

Browse files
authored
chore: add pgadmin to dev environment
1 parent 732cecf commit 82d0d42

5 files changed

Lines changed: 46 additions & 18 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
"ms-playwright.playwright",
2929
"ms-python.python",
3030
"ms-python.vscode-pylance",
31-
"ms-python.pylint",
32-
"mtxr.sqltools-driver-pg",
33-
"mtxr.sqltools",
3431
"mutantdino.resourcemonitor",
3532
"oderwat.indent-rainbow",
3633
"redhat.vscode-yaml",
@@ -63,27 +60,13 @@
6360
"./ietf",
6461
"-p",
6562
"test*.py"
66-
],
67-
"sqltools.connections": [
68-
// Default connection to dev DB container
69-
{
70-
"name": "Local PostgreSQL",
71-
"server": "db",
72-
"port": 5432,
73-
"database": "ietf",
74-
"username": "django",
75-
"password": "RkTkDPFnKpko",
76-
"driver": "PostgreSQL",
77-
"askForPassword": false,
78-
"connectionTimeout": 60
79-
}
8063
]
8164
}
8265
}
8366
},
8467

8568
// Use 'forwardPorts' to make a list of ports inside the container available locally.
86-
"forwardPorts": [8000, 5432],
69+
"forwardPorts": [8000, 5432, 5433],
8770

8871
"portsAttributes": {
8972
"3000": {
@@ -94,6 +77,10 @@
9477
"label": "PostgreSQL",
9578
"onAutoForward": "silent"
9679
},
80+
"5433": {
81+
"label": "pgAdmin",
82+
"onAutoForward": "silent"
83+
},
9784
"8000": {
9885
"label": "Datatracker",
9986
"onAutoForward": "notify"

.devcontainer/docker-compose.extend.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@ services:
1515
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
1616
network_mode: service:db
1717

18+
pgadmin:
19+
network_mode: service:db
20+
1821
volumes:
1922
datatracker-vscode-ext:

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ services:
4646
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
4747
# (Adding the "ports" property to this file will not forward from a Codespace.)
4848

49+
pgadmin:
50+
image: dpage/pgadmin4:latest
51+
restart: unless-stopped
52+
environment:
53+
- PGADMIN_DEFAULT_EMAIL=dev@ietf.org
54+
- PGADMIN_DEFAULT_PASSWORD=dev
55+
- PGADMIN_CONFIG_LOGIN_BANNER="Login with dev@ietf.org / dev"
56+
- PGADMIN_LISTEN_PORT=5433
57+
- PGADMIN_DISABLE_POSTFIX=True
58+
- PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False
59+
volumes:
60+
- ./docker/configs/pgadmin-servers.json:/pgadmin4/servers.json
61+
4962
mq:
5063
image: rabbitmq:3-alpine
5164
restart: unless-stopped
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"Servers": {
3+
"1": {
4+
"Name": "Local Dev",
5+
"Group": "Servers",
6+
"Host": "db",
7+
"Port": 5432,
8+
"MaintenanceDB": "postgres",
9+
"Username": "django",
10+
"UseSSHTunnel": 0,
11+
"TunnelPort": "22",
12+
"TunnelAuthentication": 0,
13+
"KerberosAuthentication": false,
14+
"ConnectionParameters": {
15+
"sslmode": "prefer",
16+
"connect_timeout": 10,
17+
"sslcert": "<STORAGE_DIR>/.postgresql/postgresql.crt",
18+
"sslkey": "<STORAGE_DIR>/.postgresql/postgresql.key"
19+
}
20+
}
21+
}
22+
}

docker/docker-compose.extend.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ services:
1515
db:
1616
ports:
1717
- '5432'
18+
pgadmin:
19+
ports:
20+
- '5433'
1821
celery:
1922
volumes:
2023
- .:/workspace

0 commit comments

Comments
 (0)