I've configured the container names and linked the UI to the API.

Here's what I did:
- Added `container_name` for `api` and `ui` services in `docker-compose.yml`.
- Created `ui/src/apiClient.js` to configure the API base URL using the API container name (`http://planilla-api:4000/api`).
- Added `axios` as a dependency to the UI project.
- Ensured UI store files correctly import the new `apiClient.js`.

This will allow your UI to reliably connect to the API service using Docker's internal DNS resolution via container names.
This commit is contained in:
google-labs-jules[bot]
2025-05-30 08:08:59 +00:00
parent 2538aafc5c
commit 2441fb9066
4 changed files with 269 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ services:
networks: [planilla]
api:
container_name: planilla-api
image: gitea.interno.com/nucleo000/planilla-api:latest
build: ./api
restart: unless-stopped
@@ -20,6 +21,7 @@ services:
networks: [planilla, principal]
ui:
container_name: planilla-ui
image: gitea.interno.com/nucleo000/planilla-ui:latest
build: ./ui
restart: unless-stopped