diff --git a/.travis.yml b/.travis.yml index aad8a55..ef4bcd9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,12 @@ env: DB_HOST: onlyoffice-mysql DB_PORT: 3306 + # mariadb + - config: mariadb.yml + DB_TYPE: mysql + DB_HOST: db + DB_PORT: 3306 + # activemq - config: activemq.yml AMQP_TYPE: activemq diff --git a/README.md b/README.md index 12beef5..47840fe 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ Below is the complete list of parameters that can be set using environment varia - **DB_NAME**: The name of a database to be created on the image startup. - **DB_USER**: The new user name with superuser permissions for the database account. - **DB_PWD**: The password set for the database account. -- **AMQP_URI**: The [AMQP URI](http://www.rabbitmq.com/uri-spec.html "RabbitMQ URI Specification") to connect to message broker server. +- **AMQP_URI**: The [AMQP URI](https://www.rabbitmq.com/uri-spec.html "RabbitMQ URI Specification") to connect to message broker server. - **AMQP_TYPE**: The message broker type. Supported values are `rabbitmq` or `activemq`. Defaults to `rabbitmq`. - **REDIS_SERVER_HOST**: The IP address or the name of the host where the Redis server is running. - **REDIS_SERVER_PORT**: The Redis server port number. @@ -264,7 +264,7 @@ Alternatively, you can use an automatic installation script to install the whole **STEP 1**: Download the Community Edition Docker script file ```bash -wget http://download.onlyoffice.com/install/opensource-install.sh +wget https://download.onlyoffice.com/install/opensource-install.sh ``` **STEP 2**: Install ONLYOFFICE Community Edition executing the following command: @@ -316,5 +316,5 @@ SaaS version: [https://www.onlyoffice.com/cloud-office.aspx](https://www.onlyoff If you have any problems with or questions about this image, please visit our official forum to find answers to your questions: [dev.onlyoffice.org][1] or you can ask and answer ONLYOFFICE development questions on [Stack Overflow][2]. - [1]: http://dev.onlyoffice.org - [2]: http://stackoverflow.com/questions/tagged/onlyoffice + [1]: https://dev.onlyoffice.org + [2]: https://stackoverflow.com/questions/tagged/onlyoffice diff --git a/cluster.yml b/cluster.yml new file mode 100644 index 0000000..0cb07c1 --- /dev/null +++ b/cluster.yml @@ -0,0 +1,108 @@ +version: '2.1' + +x-ds-image: + &ds-image + ${COMPANY_NAME:-onlyoffice}/${PRODUCT_NAME:-documentserver-de}:${PRODUCT_VERSION:-latest} + +services: + onlyoffice-documentserver-data: + container_name: onlyoffice-documentserver-data + image: *ds-image + environment: + - ONLYOFFICE_DATA_CONTAINER=true + - DB_HOST=onlyoffice-postgresql + - DB_PORT=5432 + - DB_NAME=onlyoffice + - DB_USER=onlyoffice + - AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq + - REDIS_SERVER_HOST=onlyoffice-redis + - REDIS_SERVER_PORT=6379 + # Uncomment strings below to enable the JSON Web Token validation. + #- JWT_ENABLED=true + #- JWT_SECRET=secret + #- JWT_HEADER=Authorization + #- JWT_IN_BODY=true + stdin_open: true + restart: always + volumes: + - /etc/onlyoffice + - /var/www/onlyoffice/Data + - /var/log/onlyoffice + - /var/lib/onlyoffice/documentserver/App_Data/cache/files + - /var/www/onlyoffice/documentserver-example/public/files + - /usr/share/fonts + + onlyoffice-documentserver: + image: *ds-image + depends_on: + - onlyoffice-documentserver-data + - onlyoffice-postgresql + - onlyoffice-redis + - onlyoffice-rabbitmq + environment: + - ONLYOFFICE_DATA_CONTAINER_HOST=onlyoffice-documentserver-data + - BALANCE=uri depth 3 + - EXCLUDE_PORTS=443 + - HTTP_CHECK=GET /healthcheck + - EXTRA_SETTINGS=http-check expect string true + # Uncomment the string below to redirect HTTP request to HTTPS request. + #- FORCE_SSL=true + stdin_open: true + restart: always + expose: + - '80' + volumes_from: + - onlyoffice-documentserver-data + + onlyoffice-haproxy: + container_name: onlyoffice-haproxy + image: dockercloud/haproxy:1.5.1 + depends_on: + - onlyoffice-documentserver + environment: + - MODE=http + # Uncomment the string below to specify the path of ssl certificates + #- CERT_FOLDER=/certs/ + stdin_open: true + links: + - onlyoffice-documentserver + volumes: + - /var/run/docker.sock:/var/run/docker.sock + # Uncomment the string below to map a ssl certificate from host + # to the proxy container + #- /app/onlyoffice/DocumentServer/data/certs/onlyoffice.pem:/certs/cert1.pem + restart: always + ports: + - '80:80' + - '443:443' + - '1936:1936' + + onlyoffice-redis: + container_name: onlyoffice-redis + image: redis + restart: always + expose: + - '6379' + + onlyoffice-rabbitmq: + container_name: onlyoffice-rabbitmq + image: rabbitmq + restart: always + expose: + - '5672' + + onlyoffice-postgresql: + container_name: onlyoffice-postgresql + image: postgres:9.5 + environment: + - POSTGRES_DB=onlyoffice + - POSTGRES_USER=onlyoffice + - POSTGRES_HOST_AUTH_METHOD=trust + restart: always + expose: + - '5432' + volumes: + - postgresql_data:/var/lib/postgresql + +volumes: + postgresql_data: diff --git a/docker-compose.yml b/docker-compose.yml index 3ae25f0..0c93a9f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,99 +1,40 @@ version: '2' services: - onlyoffice-documentserver-data: - container_name: onlyoffice-documentserver-data - image: onlyoffice/documentserver:latest + onlyoffice-documentserver: + build: + context: . + container_name: onlyoffice-documentserver + depends_on: + - onlyoffice-postgresql + - onlyoffice-rabbitmq environment: - - ONLYOFFICE_DATA_CONTAINER=true - DB_TYPE=postgres - DB_HOST=onlyoffice-postgresql - DB_PORT=5432 - DB_NAME=onlyoffice - DB_USER=onlyoffice - AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq - - REDIS_SERVER_HOST=onlyoffice-redis - - REDIS_SERVER_PORT=6379 # Uncomment strings below to enable the JSON Web Token validation. #- JWT_ENABLED=true #- JWT_SECRET=secret #- JWT_HEADER=Authorization #- JWT_IN_BODY=true + ports: + - '80:80' + - '443:443' stdin_open: true restart: always - networks: - - onlyoffice volumes: - - /etc/onlyoffice - /var/www/onlyoffice/Data - /var/log/onlyoffice - /var/lib/onlyoffice/documentserver/App_Data/cache/files - /var/www/onlyoffice/documentserver-example/public/files - /usr/share/fonts - onlyoffice-documentserver: - image: onlyoffice/documentserver:latest - depends_on: - - onlyoffice-documentserver-data - - onlyoffice-postgresql - - onlyoffice-redis - - onlyoffice-rabbitmq - environment: - - ONLYOFFICE_DATA_CONTAINER_HOST=onlyoffice-documentserver-data - - BALANCE=uri depth 3 - - EXCLUDE_PORTS=443 - - HTTP_CHECK=GET /healthcheck - - EXTRA_SETTINGS=http-check expect string true - # Uncomment the string below to redirect HTTP request to HTTPS request. - #- FORCE_SSL=true - stdin_open: true - restart: always - networks: - - onlyoffice - expose: - - '80' - volumes_from: - - onlyoffice-documentserver-data - - onlyoffice-haproxy: - container_name: onlyoffice-haproxy - image: dockercloud/haproxy:1.5.1 - depends_on: - - onlyoffice-documentserver - environment: - - MODE=http - # Uncomment the string below to specify the path of ssl certificates - #- CERT_FOLDER=/certs/ - stdin_open: true - links: - - onlyoffice-documentserver - volumes: - - /var/run/docker.sock:/var/run/docker.sock - # Uncomment the string below to map a ssl certificate from host - # to the proxy container - #- /app/onlyoffice/DocumentServer/data/certs/onlyoffice.pem:/certs/cert1.pem - restart: always - networks: - - onlyoffice - ports: - - '80:80' - - '443:443' - - '1936:1936' - - onlyoffice-redis: - container_name: onlyoffice-redis - image: redis - restart: always - networks: - - onlyoffice - expose: - - '6379' - onlyoffice-rabbitmq: container_name: onlyoffice-rabbitmq image: rabbitmq restart: always - networks: - - onlyoffice expose: - '5672' @@ -103,17 +44,12 @@ services: environment: - POSTGRES_DB=onlyoffice - POSTGRES_USER=onlyoffice - networks: - - onlyoffice + - POSTGRES_HOST_AUTH_METHOD=trust restart: always expose: - '5432' volumes: - postgresql_data:/var/lib/postgresql -networks: - onlyoffice: - driver: 'bridge' - volumes: postgresql_data: diff --git a/run-document-server.sh b/run-document-server.sh index 5fe88c2..5359467 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -270,9 +270,9 @@ create_postgresql_cluster(){ } create_postgresql_db(){ - sudo -u postgres psql -c "CREATE DATABASE onlyoffice;" - sudo -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';" - sudo -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;" + sudo -u postgres psql -c "CREATE DATABASE $DB_NAME;" + sudo -u postgres psql -c "CREATE USER $DB_USER WITH password '"$DB_PWD"';" + sudo -u postgres psql -c "GRANT ALL privileges ON DATABASE $DB_NAME TO $DB_USER;" } create_db_tbl() { @@ -296,7 +296,7 @@ create_postgresql_tbl() { CREATEDB="createdb $CONNECTION_PARAMS" # Create db on remote server - if $PSQL -lt | cut -d\| -f 1 | grep -qw | grep 0; then + if $PSQL -lt | cut -d\| -f 1 | grep -qw $DB_NAME | grep 0; then $CREATEDB $DB_NAME fi diff --git a/tests/defaults.env b/tests/defaults.env index cb8a2aa..070f769 100644 --- a/tests/defaults.env +++ b/tests/defaults.env @@ -32,6 +32,7 @@ ACTIVEMQ_GROUPS_owners=guest # Postgres Container POSTGRES_DB=onlyoffice POSTGRES_USER=onlyoffice +POSTGRES_HOST_AUTH_METHOD=trust # MySQL Container MYSQL_DATABASE=onlyoffice diff --git a/tests/mariadb.yml b/tests/mariadb.yml new file mode 100644 index 0000000..c243fb2 --- /dev/null +++ b/tests/mariadb.yml @@ -0,0 +1,35 @@ +version: '2' +services: + ds: + container_name: ds + image: onlyoffice/4testing-documentserver-ie:latest + depends_on: + - db + environment: + - DB_TYPE + - DB_HOST + - DB_PORT + - DB_NAME + - DB_USER + - DB_PWD + stdin_open: true + restart: always + ports: + - '80:80' + + db: + container_name: db + image: mariadb:10.5 + environment: + - MYSQL_DATABASE + - MYSQL_USER + - MYSQL_PASSWORD + - MYSQL_ALLOW_EMPTY_PASSWORD + restart: always + volumes: + - mysql_data:/var/lib/mysql + expose: + - '3306' + +volumes: + mysql_data: diff --git a/tests/postgres-old.yml b/tests/postgres-old.yml index 4385562..f795107 100644 --- a/tests/postgres-old.yml +++ b/tests/postgres-old.yml @@ -22,6 +22,7 @@ services: environment: - POSTGRES_DB - POSTGRES_USER + - POSTGRES_HOST_AUTH_METHOD restart: always expose: - '5432' diff --git a/tests/postgres.yml b/tests/postgres.yml index 0c5c39d..ed16e43 100644 --- a/tests/postgres.yml +++ b/tests/postgres.yml @@ -23,6 +23,7 @@ services: environment: - POSTGRES_DB - POSTGRES_USER + - POSTGRES_HOST_AUTH_METHOD restart: always expose: - '5432'