mirror of
https://github.com/Thumbscrew/matrix-homeserver-docker-compose.git
synced 2025-01-18 17:45:46 +00:00
remove nginx to allow user to build own reverse proxy
remove volumes and use paths instead add ability to change Synapse port
This commit is contained in:
parent
220a1166f6
commit
d3957e90f7
11
.env.example
11
.env.example
@ -1,7 +1,10 @@
|
||||
# volume
|
||||
VOLUME_PATH=/data/matrix
|
||||
|
||||
# synapse
|
||||
SYNAPSE_IMAGE_TAG=latest
|
||||
SERVER_NAME=localhost
|
||||
CONFIG_DIR=/data
|
||||
SYNAPSE_PORT=8008
|
||||
CONFIG_FILE_NAME=homeserver.yaml
|
||||
UID=991
|
||||
GID=991
|
||||
@ -9,9 +12,3 @@ TZ=UTC
|
||||
|
||||
# postgres
|
||||
POSTGRESQL_IMAGE_TAG=14
|
||||
|
||||
# nginx
|
||||
HTTPS_PORT=443
|
||||
FEDERATION_HTTPS_PORT=8448
|
||||
SSL_CERT_PATH=/etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||
SSL_KEY_PATH=/etc/ssl/private/ssl-cert-snakeoil.key
|
@ -1,7 +1,3 @@
|
||||
volumes:
|
||||
synapse-data:
|
||||
postgres:
|
||||
|
||||
secrets:
|
||||
postgres_password:
|
||||
file: ./postgres_password.txt
|
||||
@ -11,7 +7,7 @@ services:
|
||||
image: postgres:${POSTGRESQL_IMAGE_TAG}
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- postgres:/var/lib/postgresql/data:rw
|
||||
- ${VOLUME_PATH}/var/lib/postgresql/data:/var/lib/postgresql/data:rw
|
||||
secrets:
|
||||
- postgres_password
|
||||
environment:
|
||||
@ -24,32 +20,14 @@ services:
|
||||
image: matrixdotorg/synapse:${SYNAPSE_IMAGE_TAG}
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- synapse-data:${CONFIG_DIR}
|
||||
- ${VOLUME_PATH}/data:/data:rw
|
||||
ports:
|
||||
- 8008:8008
|
||||
- ${SYNAPSE_PORT}:8008
|
||||
environment:
|
||||
SYNAPSE_CONFIG_DIR: ${CONFIG_DIR}
|
||||
SYNAPSE_CONFIG_PATH: ${CONFIG_DIR}/${CONFIG_FILE_NAME}
|
||||
SYNAPSE_CONFIG_DIR: /data
|
||||
SYNAPSE_CONFIG_PATH: /data/${CONFIG_FILE_NAME}
|
||||
UID: ${UID}
|
||||
GID: ${GID}
|
||||
TZ: ${TZ}
|
||||
depends_on:
|
||||
- postgres
|
||||
|
||||
nginx:
|
||||
build: nginx
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 443:443
|
||||
- 8448:8448
|
||||
volumes:
|
||||
- ${SSL_CERT_PATH}:${SSL_CERT_PATH}:ro
|
||||
- ${SSL_KEY_PATH}:${SSL_KEY_PATH}:ro
|
||||
environment:
|
||||
SERVER_NAME: ${SERVER_NAME}
|
||||
HTTPS_PORT: ${HTTPS_PORT}
|
||||
FEDERATION_HTTPS_PORT: ${FEDERATION_HTTPS_PORT}
|
||||
SSL_CERT_PATH: ${SSL_CERT_PATH}
|
||||
SSL_KEY_PATH: ${SSL_KEY_PATH}
|
||||
depends_on:
|
||||
- synapse
|
||||
|
@ -1,9 +0,0 @@
|
||||
FROM nginx:latest
|
||||
|
||||
COPY default.conf /tmp/nginx/default.conf
|
||||
|
||||
COPY docker-entrypoint.sh /tmp/docker-entrypoint.sh
|
||||
RUN chmod 755 /tmp/docker-entrypoint.sh
|
||||
ENTRYPOINT [ "/tmp/docker-entrypoint.sh" ]
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
@ -1,19 +0,0 @@
|
||||
server {
|
||||
listen ${HTTPS_PORT} ssl http2;
|
||||
|
||||
# For the federation port
|
||||
listen ${FEDERATION_HTTPS_PORT} ssl http2 default_server;
|
||||
|
||||
server_name ${SERVER_NAME};
|
||||
|
||||
ssl_certificate ${SSL_CERT_PATH};
|
||||
ssl_certificate_key ${SSL_KEY_PATH};
|
||||
|
||||
location ~ ^(/_matrix|/_synapse/client) {
|
||||
proxy_pass http://synapse:8008;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
client_max_body_size 50M;
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
envsubst '${SERVER_NAME} ${HTTPS_PORT} ${FEDERATION_HTTPS_PORT} ${SSL_CERT_PATH} ${SSL_KEY_PATH}' < /tmp/nginx/default.conf > /etc/nginx/conf.d/default.conf
|
||||
|
||||
exec "$@"
|
Loading…
Reference in New Issue
Block a user