Skip to content
Snippets Groups Projects
Commit f05e3580 authored by Zitnik, Anze's avatar Zitnik, Anze
Browse files

Enable setting of API URL via environment variable.

parent 41cff35a
No related branches found
No related tags found
No related merge requests found
VUE_APP_API="https://cce-api-dev.k8s.medina.esilab.org"
VUE_APP_API="<<CCE_API_URL>>"
......@@ -22,6 +22,8 @@ RUN rm -rf /usr/share/nginx/html/*
# Copy from build stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY --from=build-stage /app/entrypoint.sh /root
RUN chmod u+x /root/entrypoint.sh
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
CMD /root/entrypoint.sh
\ No newline at end of file
......@@ -39,8 +39,7 @@ docker run -p 8081:80 registry-gitlab.xlab.si/medina/cce-frontend:latest
Before pushing to master check if version needs to be updated in [package.json](package.json#L3).
This version is also used for tagging docker image at CI.
## Setting API url
## Setting API URL
You can set the API URL in the environment file.
For local development (npm run serve) it is set in [.env.development](.env.development) and for production (docker run) in [.env.production](.env.production).
The environment must be set up before build.
\ No newline at end of file
You can set the API URL using the `CCE_API_URL` environment variable.
By default (if unset) the URL used is MEDINA k8s dev deploy: https://cce-api-dev.k8s.medina.esilab.org
URL="${CCE_API_URL:-https://cce-api-dev.k8s.medina.esilab.org}"
sed -i "s|<<CCE_API_URL>>|${CCE_API_URL}|" /usr/share/nginx/html/js/app.*.js
nginx -g 'daemon off;'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment