-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
86 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM nginx:stable-alpine-slim | ||
|
||
COPY src/nginx.template.conf /etc/nginx/nginx.template.conf | ||
ARG VERSION_TAG | ||
RUN envsubst '$VERSION_TAG' < /etc/nginx/nginx.template.conf > /etc/nginx/nginx.conf | ||
RUN nginx -t | ||
|
||
EXPOSE 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "@bluedot/posthog-proxy", | ||
"version": "1.0.0", | ||
"private": true, | ||
"scripts": { | ||
"deploy:prod": "tools/deployDocker.sh" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
http { | ||
server { | ||
listen 80; | ||
add_header X-BlueDot-Version '$VERSION_TAG'; | ||
|
||
# Redirect the course hub homepage back to the main website | ||
location = / { | ||
if ($host ~* ^[^.]+\.(.+)$) { | ||
set $parent_domain $1; | ||
rewrite ^ https://$parent_domain permanent; | ||
} | ||
} | ||
|
||
location / { | ||
proxy_pass https://eu.posthog.com; | ||
proxy_redirect off; | ||
proxy_ssl_session_reuse off; | ||
proxy_ssl_server_name on; | ||
proxy_set_header Host eu.posthog.com; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} | ||
} | ||
|
||
events {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
|
||
cd $(dirname "${BASH_SOURCE[0]:-$0}")/.. | ||
|
||
APP_NAME=$(basename "$PWD") | ||
REPO_URL="sjc.vultrcr.com/bluedot" | ||
IMAGE_NAME="bluedot-$APP_NAME" | ||
VERSION_TAG="$(TZ=UTC date +'%Y%m%d.%H%M%S').$(git rev-parse --short HEAD)" | ||
|
||
# Build | ||
APP_NAME=$APP_NAME VERSION_TAG=$VERSION_TAG npm run build --if-present | ||
docker build --platform="linux/amd64" -t $IMAGE_NAME --build-arg APP_NAME="$APP_NAME" --build-arg VERSION_TAG="$VERSION_TAG" . | ||
|
||
# Tag and push to registry | ||
docker tag $IMAGE_NAME $REPO_URL/$IMAGE_NAME:$VERSION_TAG | ||
docker tag $IMAGE_NAME $REPO_URL/$IMAGE_NAME:latest | ||
docker push $REPO_URL/$IMAGE_NAME:$VERSION_TAG | ||
docker push $REPO_URL/$IMAGE_NAME:latest | ||
|
||
# Restart nodes in cluster so they pull the new image | ||
kubectl rollout restart deployment $IMAGE_NAME-deployment | ||
kubectl rollout status deployment $IMAGE_NAME-deployment |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.