Skip to content

Commit

Permalink
Merge pull request #4 from bancodobrasil/feat/add-metrics
Browse files Browse the repository at this point in the history
Feat/add metrics
  • Loading branch information
ralphg6 authored Jan 20, 2023
2 parents 43ad396 + 421f93d commit b4b24ca
Show file tree
Hide file tree
Showing 12 changed files with 17,911 additions and 758 deletions.
7 changes: 6 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
node_modules
docker-compose.yml
.git
.gitignore
.env*
Dockerfile
.dockerignore
node_modules
npm-debug.log
dist
dist
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.exe filter=lfs diff=lfs merge=lfs -text
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "Launch app",
"type": "node",
"request": "launch",
"args": [
"src/main.ts"
],
"runtimeArgs": [
"-r",
"ts-node/register",
"-r",
"tsconfig-paths/register"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart",
"env": {
"NODE_ENV": "local",
"NODE_PORT": "9000"
},
"sourceMaps": true,
"console": "internalConsole",
"outputCapture": "std"
}
21 changes: 8 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
# Base image
FROM node:18
FROM node:16-alpine

# Create app directory
WORKDIR /usr/src/app
WORKDIR /app

# A wildcard is used to ensure both package.json AND package-lock.json are copied
COPY package*.json ./
COPY package.json yarn.lock ./

# Install app dependencies
RUN npm install
RUN yarn install --frozen-lockfile && yarn cache clean

# Bundle app source
COPY . .

# Creates a "dist" folder with the production build
RUN npm run build
RUN yarn build

# Start the server using the production build
CMD [ "node", "dist/src/main.js" ]
EXPOSE 3000

CMD ["yarn", "start"]
38 changes: 37 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
version: '3.6'

volumes:
grafana-storage:

services:

db:
image: mysql:8-debian
restart: always
Expand All @@ -12,6 +17,38 @@ services:
MYSQL_DATABASE: 'api'
MYSQL_USER: 'api'
MYSQL_PASSWORD: 'api'

prometheus:
image: bitnami/prometheus
ports:
- 9090:9090
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
links:
- api

grafana:
image: grafana/grafana
ports:
- 4000:3000
volumes:
- grafana-storage:/var/lib/grafana

environment:
GF_INSTALL_PLUGINS: "grafana-clock-panel,grafana-simple-json-datasource"
GF_SECURITY_ADMIN_PASSWORD: "admin"

api:
build: .
ports:
- 3000:3000
environment:
- JAMIE_API_DATABASE_HOST=db
- JAMIE_API_DATABASE_PORT=3306
- JAMIE_API_DATABASE_NAME=api
- JAMIE_API_DATABASE_USER=api
- JAMIE_API_DATABASE_PASSWORD=api

jaeger:
image: jaegertracing/all-in-one:1.41
environment:
Expand All @@ -29,4 +66,3 @@ services:
- 6832:6832
- 9411:9411


Loading

0 comments on commit b4b24ca

Please sign in to comment.