diff --git a/eodag/docker/nginx.conf b/eodag/docker/nginx.conf index 3e99505..6008483 100644 --- a/eodag/docker/nginx.conf +++ b/eodag/docker/nginx.conf @@ -1,12 +1,26 @@ server { listen 80 default_server; listen [::]:80 default_server; - - root /usr/share/nginx/html; - index index.html index.htm; server_name _; + location / { - try_files $uri $uri/ =404; + # Path to your client application files (HTML, CSS, JavaScript, etc.) + root /usr/share/nginx/html; + index index.html index.htm; + + try_files $uri $uri/ /index.html; + } + + location /api/ { + # Proxy pass to your API server running on port 5000 + proxy_pass http://127.0.0.1:5000/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; } + + } + diff --git a/eodag/docker/run-stac-server-browser.sh b/eodag/docker/run-stac-server-browser.sh index 1dbdd36..24607b9 100644 --- a/eodag/docker/run-stac-server-browser.sh +++ b/eodag/docker/run-stac-server-browser.sh @@ -1,5 +1,8 @@ #!/bin/bash # some pre-start operation + +nginx + LOGGING_OPTIONS="" re='^[0-9]+$' if [[ ${EODAG_LOGGING} =~ $re ]] && [ "${EODAG_LOGGING} " -gt "0" ]; then @@ -7,6 +10,9 @@ if [[ ${EODAG_LOGGING} =~ $re ]] && [ "${EODAG_LOGGING} " -gt "0" ]; then else echo "Logging level can be changed using EODAG_LOGGING environment variable [1-3]" fi + +#export EODAG_CORS_ALLOWED_ORIGINS=http://127.0.0.1:5001 + # start - exec "$@" & - exec eodag $LOGGING_OPTIONS serve-rest -w +exec "$@" & +exec eodag $LOGGING_OPTIONS serve-rest -w diff --git a/eodag/docker/server-stac-browser.dockerfile b/eodag/docker/server-stac-browser.dockerfile index 82549a9..77929c2 100644 --- a/eodag/docker/server-stac-browser.dockerfile +++ b/eodag/docker/server-stac-browser.dockerfile @@ -9,7 +9,8 @@ RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y git #clone repository -RUN git clone https://github.com/radiantearth/stac-browser.git +#RUN git clone https://github.com/radiantearth/stac-browser.git +COPY ./stac-browser /stac-browser # move to folder WORKDIR /stac-browser @@ -18,7 +19,7 @@ WORKDIR /stac-browser RUN npm install # start application -RUN npm run build -- --catalogUrl=http://localhost:5000 +RUN npm run build ########################## # BROWSER # @@ -103,11 +104,12 @@ COPY --from=build-stac /stac-browser/dist /usr/share/nginx/html COPY ./docker/run-stac-server-browser.sh /eodag/run-stac-server.sh # and make executable -RUN chmod +x /eodag/run-stac-server.sh +RUN chmod +x /eodag/run-stac-server.sh && \ + apt update && apt install -y htop # switch to non-root user #USER user # Ecrire un nouveau fichier SH pour exécuter STAC et Browser -CMD ["/usr/sbin/nginx", "-g", "daemon off;"] +#CMD ["/usr/sbin/nginx", "-g", "daemon off;"] #ENTRYPOINT ["/eodag/run-stac-server.sh"] diff --git a/eodag/interactivetool_eodag.xml b/eodag/interactivetool_eodag.xml index d82359b..451e4a0 100644 --- a/eodag/interactivetool_eodag.xml +++ b/eodag/interactivetool_eodag.xml @@ -21,7 +21,7 @@ mkdir -p ./galaxy/outputs && chmod -R 777 ./ && cd ./galaxy/ && - /init + /eodag/run-stac-server.sh ]]>