Signed-off-by: mervyn <6359152+reply2future@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| deploy_data | ||
| README.md | ||
| docker-compose.postgres.yml | ||
| docker-compose.sqlite.yml | ||
README.md
Synapse Docker
There are two docker-compose.yaml files to support sqlite and postgres databases.
-
The
postgresdatabase is recommended for production use, you could usedocker-compose.postgres.yaml. -
The
sqlitedatabase is recommended for development and testing, you could usedocker-compose.sqlite.yaml.
Please comment/uncomment sections that are not suitable for your usecase.
Go to the directory contrib/docker to run the below command.
Configuration
The container synapse-init is to generate a fresh homeserver.yaml, you can use the generate command.
(See the documentation
for more information.) You will need to specify appropriate values for at least the
SYNAPSE_SERVER_NAME and SYNAPSE_REPORT_STATS environment variables. For example:
Specify a SYNAPSE_CONFIG_PATH, preferably to a persistent path,
to use manual configuration.
You just choose one of the following options.
sqlite
- change the
SYNAPSE_SERVER_NAMEofsynapse-initat thedocker-compose.sqlite.yaml - change the local device path of
volumesat thedocker-compose.sqlite.yaml - run the command
docker-compose -f docker-compose.sqlite.yml up -d
postgres
- change the
SYNAPSE_SERVER_NAMEofsynapse-initat thedocker-compose.postgres.yaml - change the local device path of
volumesforsynapse_dataandpg_dataat thedocker-compose.postgres.yaml - create the direcotry of
pg_data, such asmkdir -p pg_data - change the postgres password by
POSTGRES_PASSWORD - run the command
docker-compose -f docker-compose.postgres.yml up -d
Validate
Open http://localhost:8008 in your browser, and it's successful if you see the welcome page.
Next
Set up a reverse proxy to expose the port and host the tls certificates. See reverse proxy
More information
For more information on required environment variables and mounts, see the main docker documentation at /docker/README.md