docker-compose invalid type, it should be a string I have the following environment variable configured in a docker-compose.yml file:

version: '3'
services:
  server:
    ports:
     - 13045:3000
    environment:
     - NODE_CONFIG: '{"DATABASE_URL":"http://db:5984"}'


When trying to run docker-compose up, I'm getting this error:

services.server.environment contains {"NODE_CONFIG": "{\"DATABASE_URL\":\"http://db:5984\"}"}, which is an invalid type, it should be a string


I need the environment variable to be set to a JSON string (see https://github.com/lorenwest/node-config/wiki/Environment-Variables#node_config)

Am I doing something wrong here? Can I get this to work somehow?
The Docker Compose file reference states, that environment variables are defined as VARIABLE=value array elements. For your case, the docker-compose.yml file would need to be changed to this:

version: '3'
services:
  server:
    ports:
     - 13045:3000
    environment:
     - NODE_CONFIG='{"DATABASE_URL":"http://db:5984"}'