Skip to content

Commit

Permalink
logging-1
Browse files Browse the repository at this point in the history
  • Loading branch information
aasdhajkshd committed Nov 18, 2023
1 parent 1e6c1b8 commit 32e16fd
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 6 deletions.
12 changes: 8 additions & 4 deletions docker/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
USERNAME=23f03013e37f
PORT=8080
UI_VERSION=1.0
POST_VERSION=1.0
COMMENT_VERSION=1.0
PORT=9292
UI_VERSION=latest
POST_VERSION=logging
COMMENT_VERSION=logging
DB_VERSION=4.4.24
PROMETHEUS_VERSION=2.1.0
FLUENT_VERSION=logging
COMPOSE_PROJECT_NAME=logging
ZIPKIN_ENABLED=true
1 change: 1 addition & 0 deletions docker/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.secrets/*
**/.env
build_info.txt
*.pyc
101 changes: 101 additions & 0 deletions docker/docker-compose-apps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
version: '3.3'
name: logging
services:
post_db:
image: mongo:${DB_VERSION}
volumes:
- post_db:/data/db
networks:
- back_net
ui:
image: ${USERNAME}/ui:${UI_VERSION}
environment:
- ZIPKIN_ENABLED=${ZIPKIN_ENABLED}
ports:
- ${PORT}:9292/tcp
networks:
- front_net
depends_on:
- fluent-bit
- post_db
- post
- comment
command: puma --debug -w 2
logging:
driver: "fluentd"
options:
fluentd-address: localhost:24224
tag: service.ui
post:
image: ${USERNAME}/post:${POST_VERSION}
environment:
- ZIPKIN_ENABLED=${ZIPKIN_ENABLED}
- COMPOSE_PROJECT_NAME
networks:
- back_net
- front_net
logging:
driver: "fluentd"
options:
fluentd-address: localhost:24224
tag: service.post
depends_on:
- fluent-bit
comment:
image: ${USERNAME}/comment:${COMMENT_VERSION}
environment:
- ZIPKIN_ENABLED=${ZIPKIN_ENABLED}
logging:
driver: "fluentd"
options:
fluentd-address: localhost:24224
tag: service.post
networks:
- back_net
- front_net
depends_on:
- fluent-bit
zipkin:
image: openzipkin/zipkin:2.21.0
ports:
- "9411:9411"
networks:
- back_net
- front_net
fluent-bit:
image: ${USERNAME}/fluent-bit:${FLUENT_VERSION}
ports:
- "24224:24224"
- "24224:24224/udp"
depends_on:
- elasticsearch
networks:
- back_net
elasticsearch:
image: elasticsearch:7.17.3
environment:
- discovery.type=single-node
expose:
- "9200"
ports:
- "9200:9200"
networks:
- back_net
kibana:
image: kibana:7.17.3
ports:
- "5601:5601"
networks:
- front_net
volumes:
post_db:
prometheus_data:
networks:
front_net:
ipam:
config:
- subnet: 10.0.1.0/24
back_net:
ipam:
config:
- subnet: 10.0.2.0/24
25 changes: 25 additions & 0 deletions docker/docker-compose-logging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '3'
services:
zipkin:
image: openzipkin/zipkin:2.21.0
ports:
- "9411:9411"
fluent-bit:
image: ${USERNAME}/fluent-bit:${FLUENT_VERSION}
ports:
- "24224:24224"
- "24224:24224/udp"
depends_on:
- elasticsearch
elasticsearch:
image: elasticsearch:7.17.3
environment:
- discovery.type=single-node
expose:
- "9200"
ports:
- "9200:9200"
kibana:
image: kibana:7.17.3
ports:
- "5601:5601"
20 changes: 18 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: '3.3'
name: logging
services:
post_db:
image: mongo:${DB_VERSION}
Expand All @@ -8,6 +9,8 @@ services:
- back_net
ui:
image: ${USERNAME}/ui:${UI_VERSION}
environment:
- ZIPKIN_ENABLED=${ZIPKIN_ENABLED}
ports:
- ${PORT}:9292/tcp
networks:
Expand All @@ -17,13 +20,28 @@ services:
- post
- comment
command: puma --debug -w 2
logging:
driver: "fluentd"
options:
fluentd-address: localhost:24224
tag: service.ui
post:
image: ${USERNAME}/post:${POST_VERSION}
environment:
- ZIPKIN_ENABLED=${ZIPKIN_ENABLED}
- COMPOSE_PROJECT_NAME
networks:
- back_net
- front_net
logging:
driver: "fluentd"
options:
fluentd-address: localhost:24224
tag: service.post
comment:
image: ${USERNAME}/comment:${COMMENT_VERSION}
environment:
- ZIPKIN_ENABLED=${ZIPKIN_ENABLED}
networks:
- back_net
- front_net
Expand Down Expand Up @@ -73,11 +91,9 @@ services:
networks:
- back_net
- front_net

volumes:
post_db:
prometheus_data:

networks:
front_net:
ipam:
Expand Down

0 comments on commit 32e16fd

Please sign in to comment.