From d01ca8b20cbc48f191cefb53af3921f848c408a8 Mon Sep 17 00:00:00 2001 From: jmal Date: Wed, 22 May 2024 15:52:27 +0800 Subject: [PATCH] chore: update Dockerfile --- Dockerfile | 2 +- config.js => config.js.template | 0 docker-entrypoint.sh | 5 ++++- 3 files changed, 5 insertions(+), 2 deletions(-) rename config.js => config.js.template (100%) diff --git a/Dockerfile b/Dockerfile index b5a9a69..3f440dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ COPY nginx.conf /etc/nginx/nginx.conf.template COPY dist /var/www/public -COPY config.js /var/www/public +COPY config.js.template /var/www/public/config.js.template COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh diff --git a/config.js b/config.js.template similarity index 100% rename from config.js rename to config.js.template diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index b670073..b3d5ee3 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,4 +1,7 @@ #!/bin/bash set -e -envsubst < /var/www/public/config.js > /var/www/public/config.js +export API_URL= +export API_OFFICE_URL= +envsubst '${API_URL} ${API_OFFICE_URL}' < /var/www/public/config.js.template > /var/www/public/config.js +cat /var/www/public/config.js exec "$@"