Skip to content

Commit

Permalink
Replace localhost with DNS entries in docker-compose - fix #91
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis CLAVIER committed Mar 31, 2022
1 parent 04f4661 commit 8f1f233
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 23 deletions.
19 changes: 12 additions & 7 deletions Demo/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
"RestrictLinkPreviews": "",
"EnableTesting": false,
"EnableDeveloper": false,
"DeveloperFlags": "",
"EnableClientPerformanceDebugging": false,
"EnableOpenTracing": false,
"EnableSecurityFixAlert": true,
"EnableInsecureOutgoingConnections": false,
Expand Down Expand Up @@ -85,6 +87,7 @@
"EnableBotAccountCreation": false,
"EnableSVGs": true,
"EnableLatex": true,
"EnableInlineLatex": true,
"EnableAPIChannelDeletion": false,
"EnableLocalMode": false,
"LocalModeSocketLocation": "/var/tmp/mattermost_local.socket",
Expand All @@ -95,7 +98,7 @@
"ThreadAutoFollow": true,
"CollapsedThreads": "disabled",
"ManagedResourcePaths": "",
"EnableReliableWebSockets": false
"EnableCustomGroups": true
},
"TeamSettings": {
"SiteName": "Mattermost",
Expand Down Expand Up @@ -123,8 +126,6 @@
"ClientRequirements": {
"AndroidLatestVersion": "",
"AndroidMinVersion": "",
"DesktopLatestVersion": "",
"DesktopMinVersion": "",
"IosLatestVersion": "",
"IosMinVersion": ""
},
Expand All @@ -141,6 +142,7 @@
"AtRestEncryptKey": "95ps7omhzmhusdfqh5bki5ye4xfd4hgw",
"QueryTimeout": 30,
"DisableDatabaseSearch": false,
"MigrationsStatementTimeoutSeconds": 100000,
"ReplicaLagSettings": []
},
"LogSettings": {
Expand Down Expand Up @@ -289,8 +291,8 @@
"Id": "123456789abcdef123456789abcdef",
"Scope": "",
"AuthEndpoint": "http://localhost/oauth/authorize",
"TokenEndpoint": "http://localhost/oauth/token.php",
"UserAPIEndpoint": "http://localhost/oauth/resource.php",
"TokenEndpoint": "http://webserver/oauth/token.php",
"UserAPIEndpoint": "http://webserver/oauth/resource.php",
"DiscoveryEndpoint": "",
"ButtonText": "",
"ButtonColor": ""
Expand Down Expand Up @@ -493,8 +495,10 @@
"DataRetentionSettings": {
"EnableMessageDeletion": false,
"EnableFileDeletion": false,
"EnableBoardsDeletion": false,
"MessageRetentionDays": 365,
"FileRetentionDays": 365,
"BoardsRetentionDays": 365,
"DeletionJobStartTime": "02:00",
"BatchSize": 3000
},
Expand All @@ -515,7 +519,8 @@
},
"JobSettings": {
"RunJobs": true,
"RunScheduler": true
"RunScheduler": true,
"CleanupJobsThresholdDays": -1
},
"PluginSettings": {
"Enable": true,
Expand All @@ -529,7 +534,7 @@
"BotUserID": "gawh538krt8w7mj1irqb9k65to"
},
"playbooks": {
"BotUserID": "cak9zgjpx78x8gbab9w8iftgxc"
"BotUserID": "fdmzdn3m4bgu8bhd48etu6dqjr"
}
},
"PluginStates": {
Expand Down
15 changes: 9 additions & 6 deletions Demo/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
LDAP_READONLY_USER_USERNAME: "butler"
LDAP_READONLY_USER_PASSWORD: "readonly"

nginx:
webserver:
image: nginx
restart: always
ports:
Expand All @@ -28,31 +28,34 @@ services:
volumes:
- ../oauth:/var/www/html/oauth
- ./nginx.conf:/etc/nginx/nginx.conf
links:
- "php:php"
depends_on:
- php

php:
build: ../Docker/php-ldap-pgsql
image: php-ldap-pgsql
volumes:
- ../oauth:/var/www/html/oauth
environment:
ldap_host: ldap://localhost:389/
ldap_host: ldap://ldap:389/
ldap_port: 389
ldap_version: 3
ldap_search_attribute: uid
ldap_base_dn: "dc=example,dc=com"
ldap_filter: "(objectClass=*)"
ldap_bind_dn: "cn=butler,dc=example,dc=com"
ldap_bind_pass: "readonly"
db_host: "127.0.0.1"
db_host: "database"
db_port: "5432"
db_type: "pgsql"
db_name: "oauth_db"
db_user: "oauth"
db_pass: "oauth_secure-pass"
depends_on:
- database
- ldap

db:
database:
image: postgres:alpine
restart: always
volumes:
Expand Down
10 changes: 5 additions & 5 deletions Demo/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ http {

proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;

upstream mattermost {
server localhost:8065;
upstream mm-svc {
server mattermost:8065;
}

server {
Expand Down Expand Up @@ -65,7 +65,7 @@ http {
proxy_buffers 256 16k;
proxy_buffer_size 16k;
proxy_read_timeout 600s;
proxy_pass http://mattermost;
proxy_pass http://mm-svc;
}

location /oauth/gitlab/ {
Expand All @@ -84,7 +84,7 @@ http {
proxy_cache_min_uses 2;
proxy_cache_use_stale timeout;
proxy_cache_lock on;
proxy_pass http://mattermost;
proxy_pass http://mm-svc;
}

location /oauth/access_token {
Expand Down Expand Up @@ -125,7 +125,7 @@ http {
proxy_cache_min_uses 2;
proxy_cache_use_stale timeout;
proxy_cache_lock on;
proxy_pass http://mattermost;
proxy_pass http://mm-svc;
}

}
Expand Down
13 changes: 8 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: '3'
services:
nginx:
webserver:
image: nginx
restart: always
ports:
Expand All @@ -10,8 +10,8 @@ services:
- ./oauth:/var/www/html/oauth
- ./oauth.conf:/etc/nginx/conf.d/oauth.conf:ro
- ./certs:/etc/nginx/certs
links:
- "php:php"
depends_on:
- php
php:
build: ./Docker/php-ldap-pgsql
image: php-ldap-pgsql
Expand All @@ -27,13 +27,16 @@ services:
ldap_filter: "(objectClass=*)"
ldap_bind_dn: ""
ldap_bind_pass: ""
db_host: "127.0.0.1"
db_host: "database"
db_port: "5432"
db_type: "pgsql"
db_name: "oauth_db"
db_user: "oauth"
db_pass: "oauth_secure-pass"
db:
depends_on:
- database

database:
image: postgres:alpine
restart: always
volumes:
Expand Down

0 comments on commit 8f1f233

Please sign in to comment.