generated from unity-sds/unity-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified application tooling to allow for stateless production builds…
…. Environment variables will be set by AWS ECS and at container startup they will be injected into the application using a sequence of scripts integrated in the Dockerfile. This can be tested locally by using a .env.docker.local file in the .env folder and then building and running the docker image locally. This setup will allow the continued normal development using the npm run dev command. Stateful build information has been removed from the package.json as well as the corresponding .env files that are no longer necessary.
- Loading branch information
Showing
14 changed files
with
112 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,8 @@ | |
*/.git | ||
node_modules | ||
*/node_modules | ||
npm-debug.log | ||
npm-debug.log | ||
dist | ||
.swc | ||
.env | ||
!.env/.env |
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 |
---|---|---|
@@ -1 +1,17 @@ | ||
VITE_UNITY_UI_VERSION=${npm_package_version} | ||
# GENERAL | ||
VITE_UNITY_UI_VERSION=${npm_package_version} | ||
VITE_ADMIN_EMAIL=ENV_UNITY_UI_ADMIN_EMAIL | ||
|
||
# Auth | ||
VITE_AUTH_OAUTH_CLIENT_ID=ENV_UNITY_UI_AUTH_OAUTH_CLIENT_ID | ||
VITE_AUTH_OAUTH_REDIRECT_URI=ENV_UNITY_UI_AUTH_OAUTH_REDIRECT_URI | ||
VITE_AUTH_OAUTH_LOGOUT_ENDPOINT=ENV_UNITY_UI_AUTH_OAUTH_LOGOUT_ENDPOINT | ||
VITE_AUTH_OAUTH_PROVIDER_URL=ENV_UNITY_UI_AUTH_OAUTH_PROVIDER_URL | ||
VITE_AUTH_APP_ADMIN_GROUP_NAME=ENV_UNITY_UI_AUTH_APP_ADMIN_GROUP_NAME | ||
VITE_AUTH_APP_APP_VIEWER_GROUP_NAME=ENV_UNITY_UI_AUTH_APP_APP_VIEWER_GROUP_NAME | ||
|
||
# ADS | ||
VITE_ADS_URL=ENV_UNITY_UI_ADS_URL | ||
|
||
# SPS | ||
VITE_SPS_WPST_ENDPOINT=ENV_UNITY_UI_SPS_WPST_ENDPOINT |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -10,6 +10,8 @@ yarn-debug.log* | |
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
.env | ||
!.env/.env | ||
|
||
node_modules | ||
dist | ||
|
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,44 @@ | ||
export IMAGE_NAME = unity-ui | ||
export CONTAINER_NAME = unity-ui | ||
export RUN_OPTIONS = | ||
|
||
build-no-cache: RUN_OPTIONS = "--no-cache" | ||
build-no-cache: build | ||
|
||
build: | ||
docker buildx build --progress=plain $(RUN_OPTIONS) -t ${IMAGE_NAME} -f Dockerfile . | ||
|
||
destroy-container: | ||
docker container rm ${CONTAINER_NAME} | ||
|
||
destroy-image: | ||
docker image rm ${IMAGE_NAME} | ||
|
||
kill: | ||
docker kill ${CONTAINER_NAME} | ||
|
||
run: | ||
docker run --env-file=./.env/.env.docker.local -t -i --rm -p 8080:80 --name ${CONTAINER_NAME} ${IMAGE_NAME} | ||
|
||
start: | ||
docker start ${CONTAINER_NAME} | ||
|
||
stop: | ||
docker stop ${CONTAINER_NAME} | ||
|
||
# ---------------------------------------------------------------------------- | ||
# Self-Documented Makefile | ||
# ref: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html | ||
# ---------------------------------------------------------------------------- | ||
help: ## (DEFAULT) This help information | ||
@echo ==================================================================== | ||
@grep -E '^## .*$$' \ | ||
$(MAKEFILE_LIST) \ | ||
| awk 'BEGIN { FS="## " }; {printf "\033[33m%-24s\033[0m \n", $$2}' | ||
@echo | ||
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' \ | ||
$(MAKEFILE_LIST) \ | ||
| awk 'BEGIN { FS=":.*?## " }; {printf "\033[36m%-24s\033[0m %s\n", $$1, $$2}' \ | ||
# | sort | ||
.PHONY: help | ||
.DEFAULT_GOAL := help |
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,10 @@ | ||
#!/usr/bin/env bash | ||
#set -x; : "$0" "$@" # Use for debugging | ||
|
||
# Inject Environment Variables for React App | ||
source ${ENTRYPOINT_FOLDER}/env.sh | ||
|
||
rm -f /var/run/apache2/apache2.pid | ||
|
||
# Run the main container process (from the Dockerfile CMD) | ||
exec /usr/sbin/apachectl -D FOREGROUND "$@" |
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,12 @@ | ||
#!/bin/sh | ||
for i in $(env | grep ENV_UNITY_UI_) | ||
do | ||
key=$(echo $i | cut -d '=' -f 1) | ||
value=$(echo $i | cut -d '=' -f 2-) | ||
echo $key=$value | ||
# sed All files | ||
# find $UNITY_WWW_ROOT -type f -exec sed -i "s|${key}|${value}|g" '{}' + | ||
|
||
# sed .js only | ||
find $UNITY_WWW_ROOT -type f \( -name '*.js' \) -exec sed -i "s|${key}|${value}|g" '{}' + | ||
done |
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