seqcli icon indicating copy to clipboard operation
seqcli copied to clipboard

Support multiple commands on the seq-cli docker image

Open bronumski opened this issue 3 years ago • 2 comments

I have a docker compose which sets up the seq web image and then sets up the api key but I can only run one command. I would also like to be able to setup some default signals. Currently I do this:

services:
  seq-cli:
    container_name: seq-cli
    image: datalust/seqcli:latest
    command: apikey create --title='default' --token='12345678901234567890' --server=http://seq-web
    depends_on:
      - seq-web
    restart: on-failure
    networks:
      - local-infrastructure

  seq-web:
    container_name: seq-web
    image: datalust/seq:latest
    environment:
      ACCEPT_EULA: 'Y'
    restart: unless-stopped
    networks:
      - local-infrastructure
    ports:
      - '5341:5341'
      - '5342:80'

Without duplicating a bunch of things I cannot run multiple commands. It would be nice to be able to do this:

  seq-cli:
    container_name: seq-cli
    image: datalust/seqcli:latest
    command:
      - apikey create --title='default' --token='12345678901234567890' --server=http://seq-web
      - signal create ...

bronumski avatar Jul 13 '22 00:07 bronumski

Hi @bronumski ,

If you're able to put your commands in a shell script, say, init.sh:

/bin/seqcli/seqcli apikey create ...
/bin/seqcli/seqcli signal create ...
...

then you can override entrypoint to call it:

    volume: ./init.sh:/init.sh
    entrypoint: sh -c "/init.sh"

(Following this answer from Stack Overflow).

Does this help?

Best regards, Nick

nblumhardt avatar Jul 13 '22 01:07 nblumhardt

Thanks @nblumhardt for the work around, should work fine and I will give it ago when back at the office. If you happen to be making changes to the docker file in the future it would be great if this could be supported in order to eliminate the need for the extra file.

bronumski avatar Aug 28 '22 15:08 bronumski

Hi @bronumski! Looking at this again, I think it's unlikely we'll pursue multiple commands directly on the command-line in the near future: we already have both seqcli template * and Seq init scripts to support this scenario in different ways, and both are more capable than anything we'd be able to do within the constraints of a single command-line.

Did init scripts work out for you? Are you happy for us to close this one? Thanks!

nblumhardt avatar Oct 20 '22 02:10 nblumhardt

@nblumhardt I understand, we have a way so it doesn't make sense to sink (no pun intended) time into it. I can confirm the script approach worked fine so let's close this off and again thank you for your help.

bronumski avatar Oct 22 '22 21:10 bronumski

:+1: thanks @bronumski

nblumhardt avatar Oct 23 '22 23:10 nblumhardt