Skip to content

Commit

Permalink
[Lab 2 - logs ] Updating for new docker compose V2
Browse files Browse the repository at this point in the history
  • Loading branch information
SoTrx committed Feb 22, 2023
1 parent 41c8db4 commit 4130e4e
Showing 1 changed file with 34 additions and 114 deletions.
148 changes: 34 additions & 114 deletions src/Lab2/6-logs/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,211 +1,143 @@
version: '3'
# Snippet réutilisable permettant à un service d'utiliser
# Fluentd comme logging driver
x-log:
&fluentd
driver: "fluentd"
options:
fluentd-address: host.docker.internal:24224
tag: httpd.access


services:
############################
# Frontend
############################
command-frontend:
image: dockerutils/command-frontend
#build: ../implementations/command-frontend
ports:
- "8089:80"
environment:
- COMMAND_API_HOST=command-api
depends_on:
- redis
networks:
- hello-dapr

############################
# Command API
############################
command-api:
image: dockerutils/command-api
#build: ../implementations/command-api
networks:
- hello-dapr
links:
- "fluentd"
environment:
- PUB_URL=http://localhost:3500/v1.0/publish/order-pub-sub/orders
depends_on:
- redis
- fluentd
# logging:
# driver: "fluentd"
# options:
# fluentd-address: localhost:24224
# tag: httpd.access
logging: *fluentd
command-api-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "command-api",
"-app-port", "80",
"-log-as-json", "true",
"-dapr-grpc-port", "50002",
"-log-as-json", "true",
"-log-level", "warn",
"-config", "/config/tracing-config.yml",
"-components-path", "/components"]
volumes:
- "./components/:/components"
- "./config/:/config"
depends_on:
- command-api
- zipkin
- fluentd
network_mode: "service:command-api"
logging:
driver: "fluentd"
options:
fluentd-address: localhost:24224
tag: httpd.access
logging: *fluentd


############################
# Order Processing
############################
order-processing:
image: dockerutils/order-processing
#build: ../implementations/order-processing
depends_on:
- redis
- fluentd
links:
- "fluentd"
environment:
- STOCK_MANAGER_INVOKE_URL=http://localhost:3500/v1.0/invoke/stock-manager/method/stock
- RECEIPT_GEN_INVOKE_URL=http://localhost:3500/v1.0/invoke/receipt-generator/method/
networks:
- hello-dapr
logging: *fluentd
order-processing-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "order-processing",
"-app-port", "8080",
"-log-as-json", "true",
"-log-as-json", "true",
"-log-level", "warn",
"-config", "/config/tracing-config.yml",
"-dapr-grpc-port", "50002",
"-components-path", "/components"]
volumes:
- "./components/:/components"
- "./config/:/config"
depends_on:
- order-processing
- zipkin
- fluentd
network_mode: "service:order-processing"
logging:
driver: "fluentd"
options:
fluentd-address: localhost:24224
tag: httpd.access
logging: *fluentd


############################
# Stock Manager
############################
stock-manager:
image: dockerutils/stock-manager
#build: ../implementations/stock-manager
depends_on:
- redis
- fluentd
networks:
- hello-dapr
# logging:
# driver: "fluentd"
# options:
# fluentd-address: localhost:24224
# tag: httpd.access
links:
- fluentd
logging: *fluentd
stock-manager-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "stock-manager",
"-app-port", "8081",
"-log-as-json", "true",
"-log-level", "debug",
"-log-as-json", "true",
"-config", "/config/tracing-config.yml",
"-dapr-grpc-port", "50002",
"-components-path", "/components"]
volumes:
- "./components/:/components"
- "./config/:/config"
depends_on:
- stock-manager
- zipkin
- fluentd
network_mode: "service:stock-manager"
logging:
driver: "fluentd"
options:
fluentd-address: localhost:24224
tag: httpd.access
logging: *fluentd


############################
# Receipt Generator
############################
receipt-generator:
image: dockerutils/receipt-generator
#build: ../implementations/receipt-generator
depends_on:
- redis
- fluentd
networks:
- hello-dapr
links:
- fluentd
environment:
- RUST_LOG=debug
- MAIL_TO=
- MAILING_BINDING_URL=http://localhost:3500/v1.0/bindings/mail
# logging:
# driver: "fluentd"
# options:
# fluentd-address: localhost:24224
# tag: httpd.access

logging: *fluentd
receipt-generator-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "receipt-generator",
"-app-port", "8081",
"-log-as-json", "true",
"-log-level", "warn",
"-log-as-json", "true",
"-config", "/config/tracing-config.yml",
"-dapr-grpc-port", "50002",
"-components-path", "/components"]
volumes:
- "./components/:/components"
- "./config/:/config"
depends_on:
- receipt-generator
- zipkin
- fluentd
network_mode: "service:receipt-generator"
logging:
driver: "fluentd"
options:
fluentd-address: localhost:24224
tag: httpd.access

############################
# Zipkin
############################
zipkin:
image: openzipkin/zipkin
environment:
- TZ=CET
ports:
- 9415:9411
networks:
- hello-dapr
logging: *fluentd

############################
# Redis state stores
############################
redis:
image: "redis:alpine"
networks:
- hello-dapr

fluentd:
#image: fluent/fluentd
build: ./fluentd
volumes:
- ./fluentd/conf:/fluentd/etc
#links:
# - "elasticsearch"
ports:
- "24224:24224"
- "24224:24224/udp"
Expand Down Expand Up @@ -235,15 +167,3 @@ services:
- "5601:5601"
depends_on:
- elasticsearch


# mongo:
# image: mongo
# networks:
# - hello-dapr
# environment:
# MONGO_INITDB_ROOT_USERNAME: root
# MONGO_INITDB_ROOT_PASSWORD: example

networks:
hello-dapr:

0 comments on commit 4130e4e

Please sign in to comment.