Skip to content

Commit f3831de

Browse files
authored
chore(dev): fix internal static proxy + add /pgadmin to reverse-proxy (ietf-tools#5809)
1 parent 32b90dc commit f3831de

6 files changed

Lines changed: 14 additions & 15 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
},
6868

6969
// Use 'forwardPorts' to make a list of ports inside the container available locally.
70-
"forwardPorts": [3000, 5432, 5433, 8000],
70+
"forwardPorts": [3000, 5432, 8000],
7171

7272
"portsAttributes": {
7373
"3000": {
@@ -78,10 +78,6 @@
7878
"label": "PostgreSQL",
7979
"onAutoForward": "silent"
8080
},
81-
"5433": {
82-
"label": "pgAdmin",
83-
"onAutoForward": "silent"
84-
},
8581
"8000": {
8682
"label": "NGINX",
8783
"onAutoForward": "notify"

.devcontainer/docker-compose.extend.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,5 @@ 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-
21-
static:
22-
network_mode: service:db
23-
2418
volumes:
2519
datatracker-vscode-ext:

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ services:
5353
- PGADMIN_DEFAULT_EMAIL=dev@ietf.org
5454
- PGADMIN_DEFAULT_PASSWORD=dev
5555
- PGADMIN_CONFIG_LOGIN_BANNER="Login with dev@ietf.org / dev"
56-
- PGADMIN_LISTEN_PORT=5433
5756
- PGADMIN_DISABLE_POSTFIX=True
5857
- PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False
58+
- SCRIPT_NAME=/pgadmin
5959
volumes:
6060
- ./docker/configs/pgadmin-servers.json:/pgadmin4/servers.json
6161

docker/configs/nginx-502.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
background-color: #222;
2424
border-radius: 10px;
2525
padding: 10px 50px;
26-
display: inline-block;
2726
}
2827
i {
2928
font-size: 64px;
@@ -54,6 +53,9 @@ <h2>Could not connect to dev server.</h2>
5453
<p class="mt">Using <strong>VS Code</strong>, open the <strong>Run and Debug</strong> tab on the left and click the <i>&#x2023;</i> symbol (Run Server) to start the server.</p>
5554
<p>Otherwise, run the command <code>ietf/manage.py runserver 0.0.0.0:8001</code> from the terminal.</p>
5655
</div>
56+
<div class="mt">
57+
<p>You can manage the database at <a href="/pgadmin">/pgadmin</a>.</p>
58+
</div>
5759
<p class="mt">For more information, check out the <a href="https://github.com/ietf-tools/datatracker/blob/main/docker/README.md" target="_blank">Datatracker Development in Docker</a> guide.</p>
5860
</body>
5961
</html>

docker/configs/nginx-proxy.conf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ server {
88
server_name _;
99

1010
location /_static/ {
11-
proxy_pass http://localhost:80/;
11+
proxy_pass http://static/;
12+
}
13+
14+
location /pgadmin/ {
15+
proxy_set_header X-Script-Name /pgadmin;
16+
proxy_set_header Host $host;
17+
proxy_pass http://pgadmin;
18+
proxy_redirect off;
1219
}
1320

1421
location / {

docker/configs/settings_local.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@
5757
DE_GFM_BINARY = '/usr/local/bin/de-gfm'
5858

5959
STATIC_IETF_ORG = "/_static"
60-
STATIC_IETF_ORG_INTERNAL = "http://localhost:80"
60+
STATIC_IETF_ORG_INTERNAL = "http://static"

0 commit comments

Comments
 (0)