tacticalrmm/docker/containers/tactical-frontend/entrypoint.sh

12 lines
348 B
Bash
Raw Normal View History

2020-11-17 02:22:28 +00:00
#!/bin/bash
#
# https://www.freecodecamp.org/news/how-to-implement-runtime-environment-variables-with-create-react-app-docker-and-nginx-7f9d42a91d70/
#
# Recreate js config file
rm -rf ${PUBLIC_DIR}/env-config.js
touch ${PUBLIC_DIR}/env-config.js
# Add assignment
echo "window._env_ = {PROD_URL: \"${API_HOST}\"}" >> ${PUBLIC_DIR}/env-config.js