From b394ed315b9ee482051b57a943c57a8fe9858eb9 Mon Sep 17 00:00:00 2001 From: Maria Sanchez Date: Thu, 28 Jul 2022 22:02:22 -0600 Subject: [PATCH] docker test --- api-gateway/Dockerfile | 6 ++++++ api-gateway/src/app.module.ts | 2 +- docker-compose.yml | 13 +++++++++++++ servicio-comunidad-viviendas/Dockerfile | 6 ++++++ servicio-comunidad-viviendas/package-lock.json | 1 + servicio-comunidad-viviendas/src/app.module.ts | 2 +- 6 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 api-gateway/Dockerfile create mode 100644 docker-compose.yml create mode 100644 servicio-comunidad-viviendas/Dockerfile 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, }, },