Closed deepfriedbrain closed 2 years ago
- CONFIG=$$(cat ./docsearch-config.json | jq -r tostring)
+ CONFIG=$(cat ./docsearch-config.json | jq -r tostring)
You have an extra $
, see command substitution
Thinking again, I don't even think it's possible to run the bash command as it's yaml here
You can do it in two step
CONFIG=$(cat ./docsearch-config.json | jq -r tostring) && docker-compose up -d
(closing as it's not a scraper related issue)
Thanks for your help. That $$
was intentional because I was getting an error about $
not being valid in yaml.
Also note that &&
is not needed. Just prepending CONFIG
to docker-compose
works as well.
CONFIG=$(cat ./docsearch-config.json | jq -r tostring) docker-compose -f docsearch-compose.yml up
Thanks for your help. That
$$
was intentional because I was getting an error about$
not being valid in yaml.
Yep make sense, it's expected to read variables but having ${myEnvVar}
with the solution above would work
Also note that
&&
is not needed. Just prependingCONFIG
todocker-compose
works as well.
oops typo :D
I'm trying to create a docker compose file to run the Docsearch scraper container but I'm not able to get it to work correctly. For CONFIG, if I use $$(cat ./docsearch-config.json | jq -r tostring), I get "ValueError: CONFIG is not a valid JSON". But if I run it on the command line (on MacOS) and hard-code the JSON string into the yaml file, then it works.
Here's my docker-compose file:
Can someone help me create a proper docker compose file? Thanks.