From 98a6493e0ce6aa0d2f9cb488d35fba5faf06f02e Mon Sep 17 00:00:00 2001 From: UO282476 Date: Tue, 2 May 2023 18:08:11 +0200 Subject: [PATCH] Changed workflow and dockerfiles --- .github/workflows/lomap_en1a.yml | 7 ++++--- restapi/Dockerfile | 4 ++-- webapp/Dockerfile | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/lomap_en1a.yml b/.github/workflows/lomap_en1a.yml index 376af61..27e53dc 100644 --- a/.github/workflows/lomap_en1a.yml +++ b/.github/workflows/lomap_en1a.yml @@ -63,14 +63,15 @@ jobs: - name: Publish to Registry uses: elgohr/Publish-Docker-Github-Action@v5 env: - host: ${{ secrets.HOST_NAME }} + HOST_NAME: ${{ secrets.HOST_NAME }} + API_URI: https://${{ secrets.HOST_NAME }}:5443 with: name: arquisoft/lomap_en1a/webapp username: ${{ github.actor }} password: ${{ secrets.DOCKER_PUSH_TOKEN }} registry: ghcr.io workdir: webapp - buildargs: API_URI + buildargs: HOST_NAME docker-push-restapi: name: Push restapi Docker Image to GitHub Packages runs-on: ubuntu-latest @@ -81,7 +82,7 @@ jobs: - name: Publish to Registry uses: elgohr/Publish-Docker-Github-Action@v5 env: - API_URI: https://${{ secrets.HOST_NAME }}:5443/api + HOST_NAME: ${{ secrets.HOST_NAME }} with: name: arquisoft/lomap_en1a/restapi username: ${{ github.actor }} diff --git a/restapi/Dockerfile b/restapi/Dockerfile index 445c8c2..66fc507 100644 --- a/restapi/Dockerfile +++ b/restapi/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /app #Install the dependencies RUN npm install -ARG host="20.13.141.12" -ENV host=$host +ARG HOST_NAME="localhost" +ENV host=$HOST_NAME CMD [ "npm", "start" ] \ No newline at end of file diff --git a/webapp/Dockerfile b/webapp/Dockerfile index c570e88..f3d6d37 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -5,10 +5,10 @@ WORKDIR /app #Install the dependencies RUN npm install -ARG API_URI="https://20.13.141.12:5443/api" +ARG API_URI="https://localhost/api" ENV REACT_APP_API_URI=$API_URI -ARG host="20.13.141.12" +ARG host="localhost" ENV host=$host #Create an optimized version of the webapp