From 907bc79eac23a896581c73244a9acf1accd7e952 Mon Sep 17 00:00:00 2001 From: mervyn <6359152+reply2future@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:42:54 +0800 Subject: [PATCH] Update the `docker-compose` sqlite example Signed-off-by: mervyn <6359152+reply2future@users.noreply.github.com> --- contrib/docker/deploy_data/.gitkeep | 0 contrib/docker/docker-compose.sqlite.yml | 56 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 contrib/docker/deploy_data/.gitkeep create mode 100644 contrib/docker/docker-compose.sqlite.yml diff --git a/contrib/docker/deploy_data/.gitkeep b/contrib/docker/deploy_data/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/contrib/docker/docker-compose.sqlite.yml b/contrib/docker/docker-compose.sqlite.yml new file mode 100644 index 0000000000..172a626385 --- /dev/null +++ b/contrib/docker/docker-compose.sqlite.yml @@ -0,0 +1,56 @@ +# This compose file is compatible with Compose itself, it might need some +# adjustments to run properly with stack. + +version: '3' + +services: + + # use this container to generate the config file and then exit + synapse-init: + image: matrixdotorg/synapse:latest + container_name: synapse-init + entrypoint: 'bash' + command: "-c './start.py generate && ./start.py migrate_config'" + volumes: + - synapse_data:/data + environment: + # more environment variables are available in the project directory `./docker/conf/homeserver.yaml` + SYNAPSE_SERVER_NAME: 'changeme.com' # change to your server name + SYNAPSE_REPORT_STATS: 'yes' + SYNAPSE_NO_TLS: 'yes' + + synapse: + image: matrixdotorg/synapse:latest + container_name: synapse + # Since synapse does not retry to connect to the database, restart upon + # failure + restart: unless-stopped + # See the readme for a full documentation of the environment settings + # NOTE: You must edit homeserver.yaml to use postgres, it defaults to sqlite + environment: + - SYNAPSE_CONFIG_PATH=/data/homeserver.yaml + volumes: + # You may either store all the files in a local folder + - synapse_data:/data + # .. or you may split this between different storage points + # - ./files:/data + # - /path/to/ssd:/data/uploads + # - /path/to/large_hdd:/data/media + depends_on: + synapse-init: + # more information about condition https://github.com/compose-spec/compose-spec/blob/master/05-services.md#long-syntax-1 + condition: service_completed_successfully + # In order to expose Synapse, you could use reverse proxying, + # or you could expose the ports directly. + ports: + # http port, you could use `8448` if you unset `SYNAPSE_NO_TLS` above the `synapse-init` container + - 8008:8008/tcp + +volumes: + synapse_data: + # you need to set the local path to your data directory here or you would lost the data if you clean the volume + driver: local + driver_opts: + type: 'none' + o: 'bind' + device: '${PWD}/deploy_data' # change the `device` to your local path \ No newline at end of file