Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dev): fix internal static proxy + add /pgadmin to reverse-proxy #5809

Merged
merged 1 commit into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
},

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

"portsAttributes": {
"3000": {
Expand All @@ -78,10 +78,6 @@
"label": "PostgreSQL",
"onAutoForward": "silent"
},
"5433": {
"label": "pgAdmin",
"onAutoForward": "silent"
},
"8000": {
"label": "NGINX",
"onAutoForward": "notify"
Expand Down
6 changes: 0 additions & 6 deletions .devcontainer/docker-compose.extend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,5 @@ 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

static:
network_mode: service:db

volumes:
datatracker-vscode-ext:
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ services:
- [email protected]
- PGADMIN_DEFAULT_PASSWORD=dev
- PGADMIN_CONFIG_LOGIN_BANNER="Login with [email protected] / dev"
- PGADMIN_LISTEN_PORT=5433
- PGADMIN_DISABLE_POSTFIX=True
- PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False
- SCRIPT_NAME=/pgadmin
volumes:
- ./docker/configs/pgadmin-servers.json:/pgadmin4/servers.json

Expand Down
4 changes: 3 additions & 1 deletion docker/configs/nginx-502.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
background-color: #222;
border-radius: 10px;
padding: 10px 50px;
display: inline-block;
}
i {
font-size: 64px;
Expand Down Expand Up @@ -54,6 +53,9 @@ <h2>Could not connect to dev server.</h2>
<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>
<p>Otherwise, run the command <code>ietf/manage.py runserver 0.0.0.0:8001</code> from the terminal.</p>
</div>
<div class="mt">
<p>You can manage the database at <a href="/pgadmin">/pgadmin</a>.</p>
</div>
<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>
</body>
</html>
9 changes: 8 additions & 1 deletion docker/configs/nginx-proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ server {
server_name _;

location /_static/ {
proxy_pass http://localhost:80/;
proxy_pass http://static/;
}

location /pgadmin/ {
proxy_set_header X-Script-Name /pgadmin;
proxy_set_header Host $host;
proxy_pass http://pgadmin;
proxy_redirect off;
}

location / {
Expand Down
2 changes: 1 addition & 1 deletion docker/configs/settings_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@
DE_GFM_BINARY = '/usr/local/bin/de-gfm'

STATIC_IETF_ORG = "/_static"
STATIC_IETF_ORG_INTERNAL = "http://localhost:80"
STATIC_IETF_ORG_INTERNAL = "http://static"