make use of postgres image db init script, use their variable naming … (#100)
* make use of postgres image db init script, use their variable naming scheme, make setup-wale executable so it can actually run
This commit is contained in:
parent
c6e177cdf2
commit
142b766cde
@ -13,7 +13,7 @@ install:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
- BUILD="docker-compose up -d"
|
- BUILD="docker-compose up -d"
|
||||||
- BUILD="docker run -d --name db mattermost-prod-db && sleep 5 && docker run -d --link db -p 80:80 --name app mattermost-prod-app"
|
- BUILD="docker run -d --name db -e POSTGRES_USER=mmuser -e POSTGRES_PASSWORD=mmuser_password -e POSTGRES_DB=mattermost mattermost-prod-db && sleep 5 && docker run -d --link db -p 80:80 --name app mattermost-prod-app"
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- curl -sSf http://localhost > /dev/null
|
- curl -sSf http://localhost > /dev/null
|
||||||
|
14
README.md
14
README.md
@ -1,22 +1,26 @@
|
|||||||
# Production Docker deployment for Mattermost
|
# Production Docker deployment for Mattermost
|
||||||
|
|
||||||
This project enables deployment of a Mattermost server in a multi-node production configuration using Docker.
|
This project enables deployment of a Mattermost server in a multi-node production configuration using Docker.
|
||||||
|
|
||||||
[](https://travis-ci.org/mattermost/mattermost-docker)
|
[](https://travis-ci.org/mattermost/mattermost-docker)
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
- To install this Docker project on AWS Elastic Beanstalk please see [AWS Elastic Beanstalk Guide](./README.aws.md).
|
- To install this Docker project on AWS Elastic Beanstalk please see [AWS Elastic Beanstalk Guide](./README.aws.md).
|
||||||
- To install Mattermost without Docker directly onto a Linux-based operating systems, please see [Admin Guide](https://docs.mattermost.com/guides/administrator.html#installing-mattermost).
|
- To install Mattermost without Docker directly onto a Linux-based operating systems, please see [Admin Guide](https://docs.mattermost.com/guides/administrator.html#installing-mattermost).
|
||||||
|
|
||||||
## Installation using Docker Compose
|
## Installation using Docker Compose
|
||||||
|
|
||||||
The following instructions deploy Mattermost in a production configuration using multi-node Docker Compose set up.
|
The following instructions deploy Mattermost in a production configuration using multi-node Docker Compose set up.
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
* [docker]
|
* [docker]
|
||||||
* [docker-compose]
|
* [docker-compose]
|
||||||
|
|
||||||
|
### Database
|
||||||
|
|
||||||
|
make sure to set the appropriate values for `MM_USERNAME`, `MM_PASSWORD` and `MM_DBNAME`
|
||||||
|
|
||||||
### Install with SSL certificate
|
### Install with SSL certificate
|
||||||
|
|
||||||
1. Open docker-compose.yml and set `MATTERMOST_ENABLE_SSL` to true.
|
1. Open docker-compose.yml and set `MATTERMOST_ENABLE_SSL` to true.
|
||||||
@ -44,7 +48,7 @@ The following instructions deploy Mattermost in a production configuration using
|
|||||||
environment:
|
environment:
|
||||||
- MATTERMOST_ENABLE_SSL=false
|
- MATTERMOST_ENABLE_SSL=false
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Build and run mattermost
|
2. Build and run mattermost
|
||||||
|
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
|
@ -9,8 +9,7 @@ RUN apt-get update \
|
|||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
ADD make_db.sh /docker-entrypoint-initdb.d/
|
COPY setup-wale.sh /docker-entrypoint-initdb.d/
|
||||||
ADD setup-wale.sh /docker-entrypoint-initdb.d/
|
|
||||||
COPY docker-entrypoint1.sh /
|
COPY docker-entrypoint1.sh /
|
||||||
RUN chmod +x /docker-entrypoint1.sh
|
RUN chmod +x /docker-entrypoint1.sh
|
||||||
|
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
MM_USERNAME=${MM_USERNAME:-mmuser}
|
|
||||||
MM_PASSWORD=${MM_PASSWORD:-mmuser_password}
|
|
||||||
MM_DBNAME=${MM_DBNAME:-mattermost}
|
|
||||||
|
|
||||||
psql -v ON_ERROR_STOP=1 --username "postgres" <<- EOSQL
|
|
||||||
CREATE DATABASE $MM_DBNAME;
|
|
||||||
CREATE USER $MM_USERNAME WITH PASSWORD '$MM_PASSWORD';
|
|
||||||
GRANT ALL PRIVILEGES ON DATABASE $MM_DBNAME to $MM_USERNAME;
|
|
||||||
EOSQL
|
|
0
db/setup-wale.sh
Normal file → Executable file
0
db/setup-wale.sh
Normal file → Executable file
@ -6,9 +6,9 @@ db:
|
|||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
# uncomment the following to enable backup
|
# uncomment the following to enable backup
|
||||||
environment:
|
environment:
|
||||||
- MM_USERNAME=mmuser
|
- POSTGRES_USER=mmuser
|
||||||
- MM_PASSWORD=mmuser_password
|
- POSTGRES_PASSWORD=mmuser_password
|
||||||
- MM_DBNAME=mattermost
|
- POSTGRES_DB=mattermost
|
||||||
# - AWS_ACCESS_KEY_ID=XXXX
|
# - AWS_ACCESS_KEY_ID=XXXX
|
||||||
# - AWS_SECRET_ACCESS_KEY=XXXX
|
# - AWS_SECRET_ACCESS_KEY=XXXX
|
||||||
# - WALE_S3_PREFIX=s3://BUCKET_NAME/PATH
|
# - WALE_S3_PREFIX=s3://BUCKET_NAME/PATH
|
||||||
|
@ -10,9 +10,9 @@ services:
|
|||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
# uncomment the following to enable backup
|
# uncomment the following to enable backup
|
||||||
environment:
|
environment:
|
||||||
- MM_USERNAME=mmuser
|
- POSTGRES_USER=mmuser
|
||||||
- MM_PASSWORD=mmuser_password
|
- POSTGRES_PASSWORD=mmuser_password
|
||||||
- MM_DBNAME=mattermost
|
- POSTGRES_DB=mattermost
|
||||||
# - AWS_ACCESS_KEY_ID=XXXX
|
# - AWS_ACCESS_KEY_ID=XXXX
|
||||||
# - AWS_SECRET_ACCESS_KEY=XXXX
|
# - AWS_SECRET_ACCESS_KEY=XXXX
|
||||||
# - WALE_S3_PREFIX=s3://BUCKET_NAME/PATH
|
# - WALE_S3_PREFIX=s3://BUCKET_NAME/PATH
|
||||||
@ -28,7 +28,7 @@ services:
|
|||||||
- ./volumes/app/mattermost/data:/mattermost/data:rw
|
- ./volumes/app/mattermost/data:/mattermost/data:rw
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
environment:
|
environment:
|
||||||
# set same as db environment
|
# set same as db credentials and dbname
|
||||||
- MM_USERNAME=mmuser
|
- MM_USERNAME=mmuser
|
||||||
- MM_PASSWORD=mmuser_password
|
- MM_PASSWORD=mmuser_password
|
||||||
- MM_DBNAME=mattermost
|
- MM_DBNAME=mattermost
|
||||||
|
Reference in New Issue
Block a user