Skip to content

Commit

Permalink
fix: add dns override and address updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillip Maffettone committed Apr 10, 2024
1 parent 83bdb6b commit 7785df1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
6 changes: 4 additions & 2 deletions containers/mmm5-tax-day-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ services:

gsas-ui:
image: ghcr.io/maffettone/bluesky-adaptive-ui:latest
command: python3 /src/bluesky-adaptive-ui/bluesky_adaptive_ui/default_dash_app/app.py --agent-address gsas
entrypoint: /modify_dns.sh
command: python3 /src/bluesky-adaptive-ui/bluesky_adaptive_ui/default_dash_app/app.py --agent-address gsas-agent --agent-port 8000
environment:
- DASH_REQUEST_PATHNAME_PREFIX="/gsas/"
volumes:
- ./modify_dns.sh:/modify_dns.sh
- type: bind
source: ../../bluesky-adaptive-ui
target: /src/bluesky-adaptive-ui
Expand Down Expand Up @@ -71,7 +73,7 @@ services:
target: /var/www/html
read_only: true
depends_on:
gsas:
gsas-agent:
condition: service_started
gsas-ui:
condition: service_started
Expand Down
13 changes: 13 additions & 0 deletions containers/modify_dns.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Extract the first nameserver entry
nameserver=$(grep -m 1 'nameserver' /etc/resolv.conf)

# Recreate resolv.conf with the desired content
{
echo "search dns.podman"
echo "$nameserver"
} > /etc/resolv.conf

# Execute the original CMD passed to the script
exec "$@"
2 changes: 1 addition & 1 deletion containers/nginx/locs.d/kmeans-gsas.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
location /kmeans-gsas-agent/ {
proxy_pass http://kmeans-gsas:8000/;
proxy_pass http://kmeans-gsas-agent:8000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down

0 comments on commit 7785df1

Please sign in to comment.