diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f7370f8..fab26f04 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,16 +69,17 @@ jobs: - uses: actions/checkout@v4 - name: Publish to Registry uses: elgohr/Publish-Docker-Github-Action@v5 - env: - API_URI: http://${{ secrets.DEPLOY_HOST }}:8000 with: name: arquisoft/wiq_es6c/webapp username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io workdir: webapp - buildargs: API_URI + buildargs: API_URI1, API_URI2 platforms: linux/arm64 + env: + API_URI1: http://${{ secrets.DEPLOY_HOST }}:8000 + API_URI2: http://${{ secrets.DEPLOY_HOST }}:8100 docker-push-authservice: name: Push auth service Docker Image to GitHub Packages runs-on: ubuntu-latest diff --git a/docker-compose.yml b/docker-compose.yml index 56eedf59..8707b296 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -155,6 +155,7 @@ services: build: ./webapp depends_on: - gatewayservice + - apisgatewayservice ports: - "3000:3000" restart: always diff --git a/webapp/.env b/webapp/.env index 944580c1..5f032cf6 100644 --- a/webapp/.env +++ b/webapp/.env @@ -1,2 +1,2 @@ REACT_APP_API_ENDPOINT=http://localhost:8000 -REACT_APIS_ENDPOINT=http://localhost:8100 \ No newline at end of file +REACT_APP_APIS_ENDPOINT=http://localhost:8100 \ No newline at end of file diff --git a/webapp/Dockerfile b/webapp/Dockerfile index 3cbad8b7..28b036d8 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -6,8 +6,11 @@ WORKDIR /app #Install the dependencies RUN npm install -ARG API_URI="http://localhost:8000" -ENV REACT_APP_API_ENDPOINT=$API_URI +ARG API_URI1="http://localhost:8000" +ENV REACT_APP_API_ENDPOINT=$API_URI1 + +ARG API_URI2="http://localhost:8100" +ENV REACT_APP_APIS_ENDPOINT=$API_URI2 #Create an optimized version of the webapp RUN npm run build diff --git a/webapp/src/storeQuestion/App.jsx b/webapp/src/storeQuestion/App.jsx index 99f545c0..b169d549 100644 --- a/webapp/src/storeQuestion/App.jsx +++ b/webapp/src/storeQuestion/App.jsx @@ -11,7 +11,7 @@ function App() { const [currentPage, setCurrentPage] = useState(1); const itemsPerPage = 10; // Número de preguntas por página - const apiEndpoint = process.env.REACT_APIS_ENDPOINT || 'http://localhost:8100'; + const apiEndpoint = process.env.REACT_APP_APIS_ENDPOINT || 'http://localhost:8100'; useEffect(() => { const obtenerPreguntas = async () => { diff --git a/webapp/src/usersRanking/App.jsx b/webapp/src/usersRanking/App.jsx index 309e4045..8c838671 100644 --- a/webapp/src/usersRanking/App.jsx +++ b/webapp/src/usersRanking/App.jsx @@ -11,7 +11,8 @@ function App() { const [currentPage, setCurrentPage] = useState(1); const itemsPerPage = 10; // Número de usuarios por página - const apiEndpoint = process.env.REACT_APIS_ENDPOINT || 'http://localhost:8100'; + const apiEndpoint = process.env.REACT_APP_APIS_ENDPOINT || 'http://localhost:8100'; + console.log(process.env.REACT_APP_APIS_ENDPOINT) useEffect(() => { const obtenerUsuarios = async () => {