Skip to content

Commit

Permalink
wip: message broker
Browse files Browse the repository at this point in the history
  • Loading branch information
deal-machine committed May 13, 2024
1 parent 9a02adc commit 2431ff6
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ DB_PORT=5432
DB_PASSWORD=postgres
DB_NAME=postgres
DB_DIALECT=postgres
DB_SCHEMA=monolith
CACHE_HOST=redis
CACHE_PORT=6379
MP_URL=https://api.mercadopago.com
Expand Down
10 changes: 6 additions & 4 deletions k8s/api-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: api-configmap
namespace: orderly
data:
PORT: "3000"
NODE_ENV: "production"
DB_HOST: "${DB_IP}" # db-service
DB_USERNAME: "${DB_USERNAME}" # "postgres"
DB_HOST: db-service # "${DB_IP}"
DB_USERNAME: "postgres" # "${DB_USERNAME}"
DB_PORT: "5432"
DB_PASSWORD: "${DB_PASSWORD}" # "postgres"
DB_NAME: "${DB_NAME}" # postgres
DB_PASSWORD: "postgres" # "${DB_PASSWORD}"
DB_NAME: postgres # "${DB_NAME}"
DB_DIALECT: postgres
DB_SHEMA: "monolith"
CACHE_HOST: cache-service
CACHE_PORT: "6379"
MP_URL: "https://api.mercadopago.com"
Expand Down
1 change: 1 addition & 0 deletions k8s/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: api-deployment
namespace: orderly
spec:
replicas: 1
selector:
Expand Down
3 changes: 2 additions & 1 deletion k8s/api-hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apiVersion: autoscaling/v2
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: api-hpa
namespace: orderly
spec:
scaleTargetRef:
apiVersion: apps/v1
Expand Down
1 change: 1 addition & 0 deletions k8s/api-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: api-service
namespace: orderly
spec:
type: ClusterIP
selector:
Expand Down
1 change: 1 addition & 0 deletions src/external/infra/database/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const conn = {
database: env.dbName,
username: env.dbUser,
password: env.dbPassword,
schema: env.dbSchema,
port: env.dbPort,
logging: false,
sync: { force: true },
Expand Down
1 change: 1 addition & 0 deletions src/internal/application/configs/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const env = {
dbUser: String(process.env.DB_USERNAME),
dbPassword: String(process.env.DB_PASSWORD),
dbDialect: String(process.env.DB_DIALECT),
dbSchema: String(process.env.DB_SCHEMA),

cacheHost: String(process.env.CACHE_HOST),
cachePort: Number(process.env.CACHE_PORT),
Expand Down

0 comments on commit 2431ff6

Please sign in to comment.