seqcli
seqcli copied to clipboard
Support multiple commands on the seq-cli docker image
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 ...
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
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.
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 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.
:+1: thanks @bronumski