Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
database:
name: "psycopg2"
args:
user: "{{ POSTGRES_USER or "synapse" }}"
password: "{{ POSTGRES_PASSWORD }}"
database: "{{ POSTGRES_DB or "synapse" }}"
host: "{{ POSTGRES_HOST or "db" }}"
port: "{{ POSTGRES_PORT or "5432" }}"
cp_min: 5
cp_max: 10
version: '2.2'
services:
app:
image: matrixdotorg/synapse:latest
networks:
private: {}
ports:
- 8008:8008
environment:
SYNAPSE_SERVER_NAME: '${SYNAPSE_APP_FQDN}'
SYNAPSE_REPORT_STATS: 'no'
SYNAPSE_CONFIG_DIR: /data
SYNAPSE_DATA_DIR: /data
POSTGRES_USER: synapse
POSTGRES_PASSWORD: synapse
POSTGRES_HOST: db
POSTGRES_DB: synapse
TZ: 'Europe/Berlin'
SYNAPSE_NO_TLS: 'true'
volumes:
- /volume1/docker/synapse/app/data:/data
db:
image: postgres:9.6-alpine
networks:
private:
stop_grace_period: 1m30s
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_USER: synapse
POSTGRES_PASSWORD: synapse
POSTGRES_DB: synapse
volumes:
- /volume1/docker/synapse/db/data:/var/lib/postgresql/data
networks:
private: {}
SYNAPSE_ENABLE_REGISTRATION=1 then you can register via riot.Though, I am totaly unclear about HOW matrix is ment to be used, for instance how users are added.
I did not map a host port to the container port (as in publish the port). A container port is always private to the container and will never lead to collisions with anything outside the container.. unless you use `network_mode: host`.had to use a different port for the postgres container. The given port is blocked by another ?service?.
This pretty much depends on whether the image starts as root and executes the main process with a restricted user OR directly start as a restricted user. If the image provides a functionality to pass in UID and GID, it is generaly a good idea to identify the UID:GID of the folder, you map as a volume, and use provide them to the container, in order to make the container execute the main process using the UID:GID. Otherweise you might experience permission problems while reading/writting data into the folder. Judging by your screenshots, you already use themFurther more I added the UID and GID. Are they necessary?
Thanks for that. Didn't know that. Will also use this in the future.I did not map a host port to the container port (as in publish the port). A container port is always private to the container and will never lead to collisions with anything outside the container.. unless you use `network_mode: host`.
Everytime I tried it, I cleared the postgres container too.The postgres container will only create the user and database, if the database folder is empty. If existing data from a previous attempt exists, it will skip the database creation... Make sure it is empty when started the first time.
I just used the link section to connect them. I used only the syno docker GUI for creating the containers.Screenshots sillt hide aspects, especially when it commes to container to container interaction. Would you mind sharing the exact docker-compose.yml you used to start everything?
cat /etc/hosts
and paste the output?version: '2.2'
services:
app:
image: matrixdotorg/synapse:latest
networks:
private: {}
ports:
- 8008:8008
environment:
SYNAPSE_SERVER_NAME: 'XXXX.com'
SYNAPSE_REPORT_STATS: 'no'
SYNAPSE_CONFIG_DIR: /data
UID: 1031
PID: 100
SYNAPSE_DATA_DIR: /data
SYNAPSE_ENABLE_REGISTRATION: '1'
POSTGRES_USER: synapse
POSTGRES_PASSWORD: synapse
POSTGRES_HOST: db
POSTGRES_DB: synapse
TZ: 'Europe/Berlin'
SYNAPSE_NO_TLS: 'true'
volumes:
- /volume1/docker/matrix:/data
db:
image: postgres:9.6-alpine
networks:
private:
stop_grace_period: 1m30s
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_USER: synapse
POSTGRES_PASSWORD: synapse
POSTGRES_DB: synapse
volumes:
- /volume1/docker/matrix/db/data:/var/lib/postgresql/data
networks:
private: {}
user: {your_uid}:{your_gid}
as a node underneath db: (sibling to "image:").version: '2.2'
services:
app:
image: matrixdotorg/synapse:latest
user: 1031:100
networks:
private: {}
ports:
- 8008:8008
environment:
SYNAPSE_SERVER_NAME: 'XXX'
SYNAPSE_REPORT_STATS: 'no'
SYNAPSE_CONFIG_DIR: /data
SYNAPSE_DATA_DIR: /data
SYNAPSE_ENABLE_REGISTRATION: '1'
POSTGRES_USER: synapse
POSTGRES_PASSWORD: synapse
POSTGRES_HOST: db
POSTGRES_DB: synapse
TZ: 'Europe/Berlin'
SYNAPSE_NO_TLS: 'true'
volumes:
- /volume1/docker/matrix:/data
db:
image: postgres:9.6-alpine
user: 1035:100
networks:
private:
stop_grace_period: 1m30s
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_USER: synapse
POSTGRES_PASSWORD: synapse
POSTGRES_DB: synapse
volumes:
- /volume1/docker/matrix/db/data:/var/lib/postgresql/data
networks:
private: {}
- /volume1/docker/matrix:/data
- /volume1/docker/matrix/db/data:/var/lib/postgresql/data
chmod 1031:100 -R /volume1/docker/matrix/app
chmod 1035:100 -R /volume1/docker/matrix/db
Sadly the commands do not work. I use chown to set the permissions to the folders.Code:
chmod1031:100 -R /volume1/docker/matrix/app
chmod 1035:100 -R /volume2/docker/matrix/db
chmod: /var/run/postgresql: Operation not permitted
initdb: could not look up effective user ID 1035: user does not exist
version: '2.2'
services:
app:
image: matrixdotorg/synapse:latest
networks:
private: {}
ports:
- 8008:8008
environment:
SYNAPSE_SERVER_NAME: ''
SYNAPSE_REPORT_STATS: 'no'
SYNAPSE_CONFIG_DIR: /data
SYNAPSE_DATA_DIR: /data
UID: 1031
GID: 100
SYNAPSE_ENABLE_REGISTRATION: '1'
POSTGRES_USER: synapse
POSTGRES_PASSWORD: synapse
POSTGRES_HOST: db
POSTGRES_DB: synapse
TZ: 'Europe/Berlin'
SYNAPSE_NO_TLS: 'true'
volumes:
- /volume1/docker/matrix/app/data:/data
db:
image: postgres:9.6-alpine
user: 1035:100
networks:
private:
stop_grace_period: 1m30s
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_USER: synapse
POSTGRES_PASSWORD: synapse
POSTGRES_DB: synapse
volumes:
- /volume1/docker/matrix/db/data:/var/lib/postgresql/data
networks:
private: {}
2020-02-17 09:47:34,498 - twisted - 192 - ERROR - None - *******************************************************
2020-02-17 09:47:34,498 - twisted - 192 - ERROR - None - Database is incorrectly configured:
2020-02-17 09:47:34,498 - twisted - 192 - ERROR - None -
2020-02-17 09:47:34,498 - twisted - 192 - ERROR - None - - 'COLLATE' is set to 'en_US.utf8'. Should be 'C'
2020-02-17 09:47:34,499 - twisted - 192 - ERROR - None - - 'CTYPE' is set to 'en_US.utf8'. Should be 'C'
2020-02-17 09:47:34,499 - twisted - 192 - ERROR - None -
2020-02-17 09:47:34,499 - twisted - 192 - ERROR - None - See docs/postgres.md for more information.
2020-02-17 09:47:34,499 - twisted - 192 - ERROR - None - *******************************************************
We use essential cookies to make this site work, and optional cookies to enhance your experience.