Skip to content

Commit

Permalink
Add rights to folder
Browse files Browse the repository at this point in the history
  • Loading branch information
louptheron committed Nov 22, 2023
1 parent 5e437fa commit e75ebe6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
13 changes: 8 additions & 5 deletions frontend/src/utils/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ import type { Self } from '../domain/types/self'
/**
* Get the environment variable:
* - injected by the `env.sh` script at runtime in `window`
* - or from `import.meta.env` when running locally
* - or from `import.meta.env`
*/
export function env(name: Env) {
if ((self as Self).env) {
const injectedValue = (self as Self).env[name]
if (injectedValue === 'true' || injectedValue === 'false') {
return Boolean(injectedValue)
}

return injectedValue
if (injectedValue) {
if (injectedValue === 'true' || injectedValue === 'false') {
return Boolean(injectedValue)
}

return injectedValue
}
}

const valueFromProcess = import.meta.env[name]
Expand Down
6 changes: 4 additions & 2 deletions infra/docker/DockerfileBuildApp
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,16 @@ RUN chmod +r /home/monitorfish/runtime-env.js.template

USER root
RUN chown monitorfish /home/monitorfish/env.sh
RUN chown -R monitorfish /home/monitorfish/public
RUN chmod +x /home/monitorfish/env.sh

RUN ls
RUN envsubst < runtime-env.js.template > public/env.js

USER monitorfish

ENV VITE_GEOSERVER_LOCAL_URL=""

RUN envsubst < runtime-env.js.template > public/env.js

ENTRYPOINT ["/home/monitorfish/env.sh"]

CMD exec java -Dspring.config.additional-location="/home/monitorfish/configurations/" -jar "monitorfish-${VERSION}.jar"
Expand Down

0 comments on commit e75ebe6

Please sign in to comment.