How can I escape a $ dollar sign in a docker compose file?

You can use a $$ (double-dollar sign) when your configuration needs a literal dollar sign. You are hitting the docker-compose variable substitution, which is well documented here: Both $VARIABLE and ${VARIABLE} syntax are supported. Extended shell-style features, such as ${VARIABLE-default} and ${VARIABLE/foo/bar}, are not supported. You can use a $$ (double-dollar sign) when your configuration … Read more