Skip to content

Commit

Permalink
monitoring-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Baykanurov committed Oct 31, 2023
1 parent e766b05 commit e7fa944
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ packer/variables.json
*.retry
**/roles/jdauphantnginx/*
jdauphant.nginx
docker/.env
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,30 @@ services:

ui:
container_name: ui
build: ./ui
image: ${USERNAME:-baykanurov}/ui:${UI_IMAGE_TAG:-1.0}
command: ["puma", "--debug", "-w 2"]
ports:
- ${UI_PORT:-9292}:9292/tcp
volumes:
- ./ui:/app:consistent
- ../src/ui:/app:consistent
networks:
- front_net

post:
container_name: post
build: ./post-py
image: ${USERNAME:-baykanurov}/post:${POST_IMAGE_TAG:-1.0}
volumes:
- ./post-py:/app:consistent
- ../src/post-py:/app:consistent
networks:
- back_net
- front_net

comment:
container_name: comment
build: ./comment
image: ${USERNAME:-baykanurov}/comment:${COMMENT_IMAGE_TAG:-1.0}
command: ["puma", "--debug", "-w 2"]
volumes:
- ./comment:/app:consistent
- ../src/comment:/app:consistent
networks:
- back_net
- front_net
Expand Down
19 changes: 15 additions & 4 deletions src/docker-compose.yml → docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ services:
- post_db:/data/db
networks:
- back_net
- front_net

ui:
container_name: ui
build: ./ui
image: ${USERNAME}/ui:${UI_IMAGE_TAG}
ports:
- ${UI_PORT}:9292/tcp
Expand All @@ -20,22 +18,35 @@ services:

post:
container_name: post
build: ./post-py
image: ${USERNAME}/post:${POST_IMAGE_TAG}
networks:
- back_net
- front_net

comment:
container_name: comment
build: ./comment
image: ${USERNAME}/comment:${COMMENT_IMAGE_TAG}
networks:
- back_net
- front_net

prometheus:
image: ${USERNAME}/prometheus
ports:
- '9090:9090'
volumes:
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention=1d'
networks:
- back_net
- front_net

volumes:
post_db:
prometheus_data:

networks:
back_net:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions monitoring/prometheus/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM prom/prometheus:v2.1.0
ADD prometheus.yml /etc/prometheus/
19 changes: 19 additions & 0 deletions monitoring/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
global:
scrape_interval: '5s'

scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets:
- 'localhost:9090'

- job_name: 'ui'
static_configs:
- targets:
- 'ui:9292'

- job_name: 'comment'
static_configs:
- targets:
- 'comment:9292'
1 change: 0 additions & 1 deletion src/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
build_info.txt
prometheus/
.env

## python specific
*.pyc

0 comments on commit e7fa944

Please sign in to comment.