Synapse: Support config fragments for docker image

Created on 8 Jan 2020  路  3Comments  路  Source: matrix-org/synapse

Description:

I'm using the very nice docker image of synapse and would like to follow the default configuration and only override specific parts of it. It seems that synapse supports config fragments in a directory (which the debian package seems to be using ), but the docker image runs start.py which doesn't have the relevant flags and doesn't allow passing them in.

docker

Most helpful comment

yeah; it would be good just to pass additional commandline args through to the synapse process.

All 3 comments

yeah; it would be good just to pass additional commandline args through to the synapse process.

For now you can overwrite the entrypoint like this to use multiple configs:

docker run --entrypoint "/usr/local/bin/python -m synapse.app.homeserver --config-path=/data/homeserver.yaml --config-path=/data/another-file.yaml" ...

or using docker-compose:

  synapse:
    image: matrixdotorg/synapse
    entrypoint:
      - /usr/local/bin/python
      - -m
      - synapse.app.homeserver
      - --config-path=/data/homeserver.yaml
      - --config-path=/data/another-file.yaml

@samuel-p how would compose example look like with #8390 ?

EDIT:
Nvm, I've got it.
Example:

  synapse_worker_appservice:                                                                                                                                                                                                                
    image: matrixdotorg/synapse
    restart: unless-stopped                                                                                                                                                                                                                 
    healthcheck:                                                                                                                                                                                                                            
      test: ["CMD", "curl", "-fSs", "http://localhost:8083/health"]                                                                                                                                                                         
      interval: 1m                                                                                                                                                                                                                          
      timeout: 10s                                                                                                                                                                                                                          
      retries: 3                                                                                                                                                                                                                            
    volumes_from:                                                                                                                                                                                                                           
      - synapse                                                                                                                                                                                                                             
    depends_on:                                                                                                                                                                                                                             
      - redis                                                                                                                                                                                                                               
      - synapse                                                                                                                                                                                                                             
    environment:                                                                                                                                                                                                                            
      SYNAPSE_WORKER: synapse.app.appservice                                                                                                                                                                                                
    command:                                                                                                                                                                                                                                
      - 'run'                                                                                                                                                                                                                               
      - '--config-path=/data/homeserver.yaml'                                                                                                                                                                                               
      - '--config-path=/data/workers/appservice.yaml'
Was this page helpful?
0 / 5 - 0 ratings