dotnet / tye

Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with minimal configuration.
MIT License
5.29k stars 520 forks source link

What is the correct way to get Seq to work when ran with --docker flag? #704

Open davidhenley opened 3 years ago

davidhenley commented 3 years ago

I've tried several things but can't figure out how to get docker to work with the seq extension. I've also tried the following but can't get it to work. I use Serilog and write to http://localhost:5341

- name: logs
  image: datalust/seq:latest
  bindings:
    - port: 5341
      containerPort: 80
  env:
    - name: ACCEPT_EULA
      value: "Y"
"WriteTo": [
      { "Name": "Console" },
      {
        "Name": "Seq",
        "Args": { "serverUrl": "http://localhost:5341" }
      }
    ]
PureKrome commented 3 years ago

ME! ME! I can help!!

I think you messed up the bindings for the data port with the UI port. I'm not great with docker files, but i love using docker compose files.

for me, i'm exposing port 5301 to the internal port 5341. for accessing the UI, i'm exposing 5300 to the intern port 80.

I then access the ui in the browser at port :5300 and for my serilog app settings, i tell all logging to hit port 5301.

this is my docker compose + appsettings.json stuff:

docker-compose.yml

version: '3.5'
services:
  seq.logging:
    image: datalust/seq
    container_name: seq.logging
    environment:
      - ACCEPT_EULA=Y
    ports:
      - "5300:80" # UI
      - "5301:5341" # Data ingest

appsettings.json

{
"Serilog": {
        "MinimumLevel": {
            "Default": "Debug"
        },
        "WriteTo": [
            {
                "Name": "Console"
            },
            {
                "Name": "Seq",
                "Args": { "serverUrl": "http://localhost:5301" }
            }
        ],
        "Enrich": [ "FromLogContext" ],
        "Properties": {
            "ApplicationName": "TheBestApplication.In.The.World"
        }
    }
}

HTH