diff --git a/docker-compose.Staging.Infrastructure.yaml b/docker-compose.Staging.Infrastructure.yaml index 889f57afd..6f4112872 100644 --- a/docker-compose.Staging.Infrastructure.yaml +++ b/docker-compose.Staging.Infrastructure.yaml @@ -12,10 +12,6 @@ services: ACCEPT_EULA: "Y" healthcheck: test: /opt/mssql-tools/bin/sqlcmd -S mssql -U sa -P "$$SA_PASSWORD" -Q "SELECT 1" || exit 1 - interval: 5s - timeout: 5s - retries: 5 - start_period: 10s deploy: resources: limits: @@ -38,10 +34,6 @@ services: RABBITMQ_DEFAULT_VHOST: "eventual-shop" healthcheck: test: rabbitmq-diagnostics -q ping - interval: 5s - timeout: 5s - retries: 5 - start_period: 10s deploy: resources: limits: @@ -62,10 +54,6 @@ services: MONGO_INITDB_ROOT_PASSWORD: "secret" healthcheck: test: echo 'db.runCommand("ping").ok' | mongo mongodb:27017/test --quiet - interval: 5s - timeout: 5s - retries: 5 - start_period: 10s deploy: resources: limits: @@ -124,7 +112,7 @@ services: restart_policy: condition: any ports: - - "9200" + - "9200:9200" - "9300" networks: - internal @@ -138,12 +126,12 @@ services: ELASTICSEARCH_USERNAME: EventualShop ELASTICSEARCH_PASSWORD: EventualShop healthcheck: - test: [ "CMD", "curl", "-f", "http://kibana:5601/api/status" ] + test: [ "CMD", "curl", "-f", "http://kibana:5601/api/status" ] ports: - "5601:5601" - depends_on: - elasticsearch: - condition: service_healthy +# depends_on: +# elasticsearch: +# condition: service_healthy deploy: resources: limits: diff --git a/docker-compose.Staging.Services.yaml b/docker-compose.Staging.Services.yaml index 91723c57e..0f0555cc9 100644 --- a/docker-compose.Staging.Services.yaml +++ b/docker-compose.Staging.Services.yaml @@ -389,6 +389,8 @@ services: healthcheck: test: [ "CMD", "curl", "-f", "http://webapi/healthz" ] depends_on: + kibana: + condition: service_healthy rabbitmq: condition: service_healthy networks: diff --git a/filebeat.yml b/filebeat.yml index 2ea311ba8..15910b96f 100644 --- a/filebeat.yml +++ b/filebeat.yml @@ -1,21 +1,27 @@ filebeat.inputs: - - type: filestream - id: my-filestream-id - enabled: true + - type: container paths: - - /var/log/messages - - /var/log/*.log + - '/var/lib/docker/containers/*/*.log' + +filebeat.config.modules: + path: ${path.config}/modules.d/*.yml + +setup.ilm.overwrite: true + +action.auto_create_index: true output.elasticsearch: hosts: [ "http://elasticsearch:9200" ] + index: "eventual-shop-%{+yyyy.MM.dd}" username: "EventualShop" password: "EventualShop" - index: "EventualShop-%{+yyyy-MM-dd}" + +setup.template.enabled: true +setup.template.name: "eventual-shop" +setup.template.pattern: "eventual-shop-*" setup.kibana: host: "http://kibana:5601" -setup.template.name: "EventualShop" -setup.template.pattern: "EventualShop-*" +logging.level: debug -logging.level: info \ No newline at end of file diff --git a/src/Web/WebAPI/Dockerfile b/src/Web/WebAPI/Dockerfile index 64d6a2cb8..c3694fd6a 100644 --- a/src/Web/WebAPI/Dockerfile +++ b/src/Web/WebAPI/Dockerfile @@ -40,7 +40,4 @@ RUN sudo dpkg -i filebeat-8.6.2-amd64.deb COPY filebeat.yml /etc/filebeat/ RUN chmod go-w /etc/filebeat/filebeat.yml -CMD filebeat modules enable elasticsearch -CMD filebeat setup -CMD service filebeat start -CMD dotnet WebAPI.dll \ No newline at end of file +CMD filebeat modules enable elasticsearch && filebeat setup && service filebeat start && dotnet WebAPI.dll \ No newline at end of file diff --git a/src/Web/WebAPI/appsettings.Staging.json b/src/Web/WebAPI/appsettings.Staging.json index 5e9209bfa..54ff0274d 100644 --- a/src/Web/WebAPI/appsettings.Staging.json +++ b/src/Web/WebAPI/appsettings.Staging.json @@ -36,7 +36,7 @@ "Args": { "Formatter": "Serilog.Formatting.Elasticsearch.ElasticsearchJsonFormatter,Serilog.Formatting.Elasticsearch", "Theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console", - "OutputTemplate": "EventualShop-{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}" + "OutputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}" } } ]