diff --git a/.env.example b/.env.example index 71b86cde..3befff9c 100644 --- a/.env.example +++ b/.env.example @@ -67,3 +67,6 @@ SANCTUM_STATEFUL_DOMAINS=toby.blumilk.localhost SOPS_AGE_BETA_SECRET_KEY= SOPS_AGE_PROD_SECRET_KEY= + +# 5 minutes (in miliseconds) +VITE_LAST_UPDATE_TIMEOUT=300000 diff --git a/environment/prod/app/Dockerfile b/environment/prod/app/Dockerfile index 83e2c0b9..38a0d2e2 100644 --- a/environment/prod/app/Dockerfile +++ b/environment/prod/app/Dockerfile @@ -24,6 +24,7 @@ FROM node:21.6.2-bullseye-slim as frontend WORKDIR /app_frontend_dependencies COPY package.json package-lock.json postcss.config.js tailwind.config.js vite.config.js ./ +COPY ./environment/prod/app/vite.env .env RUN npm clean-install diff --git a/environment/prod/app/vite.env b/environment/prod/app/vite.env new file mode 100644 index 00000000..bd58f70c --- /dev/null +++ b/environment/prod/app/vite.env @@ -0,0 +1 @@ +VITE_LAST_UPDATE_TIMEOUT=300000 diff --git a/resources/js/Shared/LastUpdate.vue b/resources/js/Shared/LastUpdate.vue index 891bfa81..82377be0 100644 --- a/resources/js/Shared/LastUpdate.vue +++ b/resources/js/Shared/LastUpdate.vue @@ -23,6 +23,6 @@ const fetchLastUpdate = async () => { onMounted(() => { fetchLastUpdate() - setInterval(fetchLastUpdate, 300000) // 5 minutes + setInterval(fetchLastUpdate, import.meta.env.VITE_LAST_UPDATE_TIMEOUT) })