diff --git a/api-gateway/Dockerfile b/api-gateway/Dockerfile new file mode 100644 index 00000000..79173cc6 --- /dev/null +++ b/api-gateway/Dockerfile @@ -0,0 +1,6 @@ +FROM node:18 +RUN mkdir -p /home/app +COPY . /home/app +WORKDIR /home/app +EXPOSE 3000 +CMD ["npm", "start"] \ No newline at end of file diff --git a/api-gateway/src/app.module.ts b/api-gateway/src/app.module.ts index 64618c01..6125cc52 100644 --- a/api-gateway/src/app.module.ts +++ b/api-gateway/src/app.module.ts @@ -20,7 +20,7 @@ import { AppService } from './app.service'; name: 'SERVICIO_COMUNIDADES', transport: Transport.TCP, options: { - host: '127.0.0.1', + host: 'microserviciosNetwork', port: 3002, }, }, diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..6a0a150b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: "3.9" +services: + apiGateway: + build: ./api-gateway + networks: + - microserviciosNetwork + comunidad: + build: ./servicio-comunidad-viviendas + networks: + - microserviciosNetwork + +networks: + microserviciosNetwork \ No newline at end of file diff --git a/servicio-comunidad-viviendas/Dockerfile b/servicio-comunidad-viviendas/Dockerfile new file mode 100644 index 00000000..79173cc6 --- /dev/null +++ b/servicio-comunidad-viviendas/Dockerfile @@ -0,0 +1,6 @@ +FROM node:18 +RUN mkdir -p /home/app +COPY . /home/app +WORKDIR /home/app +EXPOSE 3000 +CMD ["npm", "start"] \ No newline at end of file diff --git a/servicio-comunidad-viviendas/package-lock.json b/servicio-comunidad-viviendas/package-lock.json index 46dd3dd0..22c95f9b 100644 --- a/servicio-comunidad-viviendas/package-lock.json +++ b/servicio-comunidad-viviendas/package-lock.json @@ -5,6 +5,7 @@ "requires": true, "packages": { "": { + "name": "servicio-comunidad-viviendas", "version": "0.0.1", "license": "UNLICENSED", "dependencies": { diff --git a/servicio-comunidad-viviendas/src/app.module.ts b/servicio-comunidad-viviendas/src/app.module.ts index 7a407e87..e6d060dc 100644 --- a/servicio-comunidad-viviendas/src/app.module.ts +++ b/servicio-comunidad-viviendas/src/app.module.ts @@ -10,7 +10,7 @@ import { ClientsModule, Transport } from '@nestjs/microservices'; name: 'SERVICIO_COMUNIDADES', transport: Transport.TCP, options: { - host: '127.0.0.1', + host: 'microserviciosNetwork', port: 3002, }, },