fix: Docker build time was very slow on a tiny change (#4559)
Co-authored-by: sedghi <ar.sedghi@gmail.com>
This commit is contained in:
1 parent
ae48f50037
commit
7e43b2f768
19 files changed
+390
-183
No files matched your search
@@ -1,4 +1,7 @@
|
||||
server {
|
||||
gzip_static always;
|
||||
gzip_proxied expired no-cache no-store private auth;
|
||||
gunzip on;
|
||||
listen ${PORT} default_server;
|
||||
listen [::]:${PORT} default_server;
|
||||
location / {
|
||||
|
||||
@@ -7,9 +7,18 @@ if [ -n "$SSL_PORT" ]
|
||||
envsubst '${PORT}' < /usr/src/default.conf.template > /etc/nginx/conf.d/default.conf
|
||||
fi
|
||||
|
||||
if [ -n "$APP_CONFIG" ]
|
||||
if [ -n "$APP_CONFIG" ] ; then
|
||||
echo "$APP_CONFIG" > /usr/share/nginx/html${PUBLIC_URL}app-config.js
|
||||
# Removes the old compressed app-config file, then compresses the replacement
|
||||
# and finally creates a new empty file so that gunzip works correctly.
|
||||
# This code is correct despite the AI warning otherwise about order of create/delete
|
||||
rm /usr/share/nginx/html${PUBLIC_URL}app-config.js.gz
|
||||
gzip /usr/share/nginx/html${PUBLIC_URL}app-config.js
|
||||
touch /usr/share/nginx/html${PUBLIC_URL}app-config.js
|
||||
fi
|
||||
if [ ! -n "$APP_CONFIG" ]
|
||||
then
|
||||
echo "$APP_CONFIG" > /usr/share/nginx/html/app-config.js
|
||||
echo "Not using custom app config"
|
||||
fi
|
||||
|
||||
if [ -n "$CLIENT_ID" ] || [ -n "$HEALTHCARE_API_ENDPOINT" ]
|
||||
@@ -40,6 +49,6 @@ if [ -n "$CLIENT_ID" ] || [ -n "$HEALTHCARE_API_ENDPOINT" ]
|
||||
cp /usr/share/nginx/html/google.js /usr/share/nginx/html/app-config.js
|
||||
fi
|
||||
|
||||
echo "Starting Nginx to serve the OHIF Viewer..."
|
||||
echo "Starting Nginx to serve the OHIF Viewer on ${PUBLIC_URL}"
|
||||
|
||||
exec "$@"
|
||||
Reference in new issue
Block a user