Skip to content

Commit

Permalink
🎉 allow users to access both the api and webapp from the same port (a…
Browse files Browse the repository at this point in the history
…irbytehq#3603)

* single port v2

* fix upstream location

* add kube support

* fix .env.dev

* set INTERNAL_API_HOST for kube
  • Loading branch information
jrhizor authored May 26, 2021
1 parent 5aa0364 commit 581b273
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ WEBAPP_URL=http://localhost:8000/
# todo - Migrate to a way to define a better default API_URL
# API_URL=http://localhost:8001/api/v1/
TEMPORAL_HOST=airbyte-temporal:7233
INTERNAL_API_HOST=airbyte-server:8001
1 change: 1 addition & 0 deletions .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ TRACKING_STRATEGY=logging
HACK_LOCAL_ROOT_PARENT=/tmp
WEBAPP_URL=http://localhost:8000/
API_URL=http://localhost:8001/api/v1/
INTERNAL_API_HOST=airbyte-server:8001
8 changes: 8 additions & 0 deletions airbyte-webapp/nginx/default.conf.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
upstream api-server {
server $INTERNAL_API_HOST;
}

server {
listen 80;
listen [::]:80;
Expand Down Expand Up @@ -29,4 +33,8 @@ server {
location = /50x.html {
root /usr/share/nginx/html;
}

location /api/ {
proxy_pass http://api-server/api/;
}
}
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ services:
- IS_DEMO=${IS_DEMO:-}
- PAPERCUPS_STORYTIME=${PAPERCUPS_STORYTIME:-}
- TRACKING_STRATEGY=${TRACKING_STRATEGY}
- INTERNAL_API_HOST=${INTERNAL_API_HOST}
airbyte-temporal:
image: temporalio/auto-setup:1.7.0
container_name: airbyte-temporal
Expand Down
1 change: 1 addition & 0 deletions kube/overlays/dev/.env
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ LOCAL_ROOT=/tmp/airbyte_local
PAPERCUPS_STORYTIME=disabled
IS_DEMO=false
TEMPORAL_HOST=airbyte-temporal-svc:7233
INTERNAL_API_HOST=http://airbyte-server-svc:8001/api/
1 change: 1 addition & 0 deletions kube/overlays/stable/.env
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ LOCAL_ROOT=/tmp/airbyte_local
PAPERCUPS_STORYTIME=enabled
IS_DEMO=false
TEMPORAL_HOST=airbyte-temporal-svc:7233
INTERNAL_API_HOST=http://airbyte-server-svc:8001/api/
5 changes: 5 additions & 0 deletions kube/resources/webapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,10 @@ spec:
configMapKeyRef:
name: airbyte-env
key: IS_DEMO
- name: INTERNAL_API_HOST
valueFrom:
configMapKeyRef:
name: airbyte-env
key: INTERNAL_API_HOST
ports:
- containerPort: 80

0 comments on commit 581b273

Please sign in to comment.