ci with broker --check

This commit is contained in:
Gsk54 2023-01-10 08:54:29 +01:00
parent d679d5b1e3
commit b8b1109fcf
4 changed files with 23 additions and 2 deletions

View File

@ -1,5 +1,11 @@
# PRISMA # PRISMA
DATABASE_URL="postgresql://user:user@v3-user-db-test:5432/user?schema=public" DATABASE_URL="postgresql://user:user@v3-user-db-test:5432/user?schema=public"
# RABBIT MQ
RMQ_URI=amqp://v3-broker:5672
# MESSAGE BROKER
BROKER_IMAGE=rabbitmq:3-alpine
# POSTGRES # POSTGRES
POSTGRES_IMAGE=postgres:15.0 POSTGRES_IMAGE=postgres:15.0

View File

@ -1,5 +1,5 @@
################### ###################
# BUILD FOR LOCAL DEVELOPMENT # BUILD FOR CI TESTING
################### ###################
FROM node:18-alpine3.16 FROM node:18-alpine3.16
@ -19,5 +19,8 @@ COPY . .
# Creates a "dist" folder # Creates a "dist" folder
RUN npm run build RUN npm run build
# Execute test suite # Execute unit tests
RUN npm run test:unit RUN npm run test:unit
# Start the server using the production build
CMD [ "node", "dist/main.js" ]

View File

@ -12,6 +12,7 @@ services:
- 5001:5001 - 5001:5001
depends_on: depends_on:
- db-test - db-test
- broker
networks: networks:
v3-network: v3-network:
aliases: aliases:
@ -31,6 +32,16 @@ services:
aliases: aliases:
- v3-user-db-test - v3-user-db-test
broker:
container_name: v3-broker
image: ${BROKER_IMAGE}
ports:
- 5672:5672
networks:
v3-network:
aliases:
- v3-broker
networks: networks:
v3-network: v3-network:
name: v3-network name: v3-network

View File

@ -32,6 +32,7 @@ import { UserProfile } from './mappers/user.profile';
}, },
], ],
uri: configService.get<string>('RMQ_URI'), uri: configService.get<string>('RMQ_URI'),
connectionInitOptions: { wait: false },
}), }),
inject: [ConfigService], inject: [ConfigService],
}), }),