diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index acd3e1a..072162e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,8 @@ docker-build: stage: build variables: DOCKER_IMAGE_NAME: olytest/hermione-fe:$CI_COMMIT_SHORT_SHA + LOCAL_DNS: '34.159.118.61 olympus-gateway.gcp.it' + VITE_BACKEND_URL: http://olympus-gateway.gcp.it/hermione before_script: - > echo '{ @@ -17,7 +19,8 @@ docker-build: --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${DOCKER_IMAGE_NAME}" - --build-arg "VITE_BACKEND_URL=https://olympus-api-gateway-nu6mvqujsq-ey.a.run.app/hermione" + --build-arg "VITE_BACKEND_URL=${VITE_BACKEND_URL}" + --build-arg "LOCAL_DNS=${LOCAL_DNS}" # Run this job in a branch where a Dockerfile exists rules: - if: $CI_COMMIT_BRANCH diff --git a/Dockerfile b/Dockerfile index 7412688..963c4a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,12 @@ WORKDIR /usr/src/app # this will allow us to run vite and other tools directly ENV PATH /usr/src/node_modules/.bin:$PATH +# Add custom DNS mapping +ARG LOCAL_DNS +RUN echo "$LOCAL_DNS" >> /etc/hosts + +RUN cat /etc/hosts + # inject all environment vars we'll need ARG VITE_BACKEND_URL ENV VITE_BACKEND_URL=$VITE_BACKEND_URL