Skip to content

Commit

Permalink
update dockerfile and db service for proto changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tmthecoder committed Jan 27, 2024
1 parent d4dc2fd commit e7123a6
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 25 deletions.
44 changes: 24 additions & 20 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,37 @@ WORKDIR /app

COPY . .

RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/*
RUN apk add --update python3 make g++ protoc bash && rm -rf /var/cache/apk/*

RUN yarn global add node-gyp prisma

WORKDIR /app/packages/proto
RUN chmod +x /app/packages/proto/gen_protos.sh

RUN yarn install --frozen-lockfile

RUN yarn build

RUN yarn install --frozen-lockfile

WORKDIR /app/packages/api-gateway

RUN yarn install --frozen-lockfile

WORKDIR /app/packages/auth-service

RUN yarn install --frozen-lockfile

WORKDIR /app/packages/db-service

RUN yarn install --frozen-lockfile
# WORKDIR /app/packages/proto
#
# RUN yarn install --frozen-lockfile
#
# RUN yarn build
#
# RUN yarn install --frozen-lockfile
#
# WORKDIR /app/packages/api-gateway
#
# RUN yarn install --frozen-lockfile
#
# WORKDIR /app/packages/auth-service
#
# RUN yarn install --frozen-lockfile
#
# WORKDIR /app/packages/db-service
#
# RUN yarn install --frozen-lockfile

FROM node:18 as gateway-dev

RUN apt update && apt install -y protobuf-compiler
# RUN apt update && apt install -y protobuf-compiler

WORKDIR /app

Expand All @@ -45,7 +49,7 @@ WORKDIR /app/packages/api-gateway

FROM node:18 as auth-service-dev

RUN apt update && apt install -y protobuf-compiler
# RUN apt update && apt install -y protobuf-compiler

WORKDIR /app

Expand All @@ -60,7 +64,7 @@ WORKDIR /app/packages/auth-service

FROM node:18 as db-service-dev

RUN apt update && apt install -y protobuf-compiler
# RUN apt update && apt install -y protobuf-compiler

WORKDIR /app

Expand Down
9 changes: 6 additions & 3 deletions packages/db-service/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { AppModule } from './app.module';
import { MicroserviceOptions, Transport } from '@nestjs/microservices';
import { join } from 'path';
import { ConfigModule } from '@nestjs/config';
import { DBSERVICE_USER_PACKAGE_NAME } from 'juno-proto/src/gen/user';
import { DBSERVICE_PROJECT_PACKAGE_NAME } from 'juno-proto/src/gen/project';
import {
UserProtoFile,
ProjectProtoFile,
IdentifiersProtoFile,
UserProto,
ProjectProto,
} from 'juno-proto';

async function bootstrap() {
Expand All @@ -20,7 +20,10 @@ async function bootstrap() {
{
transport: Transport.GRPC,
options: {
package: [DBSERVICE_USER_PACKAGE_NAME, DBSERVICE_PROJECT_PACKAGE_NAME],
package: [
UserProto.DBSERVICE_USER_PACKAGE_NAME,
ProjectProto.DBSERVICE_PROJECT_PACKAGE_NAME,
],
protoPath: [UserProtoFile, ProjectProtoFile, IdentifiersProtoFile],
url: process.env.DB_SERVICE_ADDR,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/proto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "dist/main.js",
"license": "MIT",
"scripts": {
"build": "yarn gen-proto && yarn format && tsc && ncp ./definitions ./dist/definitions",
"build": "ls && yarn gen-proto && yarn format && tsc && ncp ./definitions ./dist/definitions",
"format": "prettier --write \"src/**/*.ts\"",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
Expand All @@ -13,7 +13,7 @@
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"tsc": "tsc && cp -r ./definitions ./dist/",
"gen-proto": "./gen_protos.sh"
"gen-proto": "bash ./gen_protos.sh"
},
"dependencies": {
"@nestjs/common": "^10.3.0",
Expand Down

0 comments on commit e7123a6

Please sign in to comment.