This commit is contained in:
Alexey Golubev 2018-03-28 12:06:40 +03:00
commit 8a02d9fbe4
3 changed files with 56 additions and 62 deletions

@ -1,52 +1,47 @@
FROM ubuntu:14.04 FROM ubuntu:16.04
LABEL maintainer Ascensio System SIA <support@onlyoffice.com> LABEL maintainer Ascensio System SIA <support@onlyoffice.com>
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive
RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
apt-get -y update && \ apt-get -y update && \
apt-get --force-yes -yq install wget apt-transport-https curl && \ apt-get -yq install wget apt-transport-https curl locales && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CB2DE8E5 && \ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CB2DE8E5 && \
echo "deb http://archive.ubuntu.com/ubuntu precise main universe multiverse" >> /etc/apt/sources.list && \
locale-gen en_US.UTF-8 && \ locale-gen en_US.UTF-8 && \
curl -sL https://deb.nodesource.com/setup_6.x | bash - && \ curl -sL https://deb.nodesource.com/setup_6.x | bash - && \
apt-get -y update && \ apt-get -y update && \
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && \ apt-get -yq install \
apt-get --force-yes -yq install adduser \ adduser \
bomstrip \ bomstrip \
fonts-crosextra-carlito \ htop \
fonts-dejavu \ libasound2 \
fonts-liberation \ libboost-regex-dev \
fonts-opensymbol \ libcairo2 \
fonts-takao-gothic \ libcurl3 \
htop \ libgconf2-4 \
libasound2 \ libgtkglext1 \
libboost-regex-dev \ libnspr4 \
libcairo2 \ libnss3 \
libcurl3 \ libnss3-nssdb \
libgconf2-4 \ libstdc++6 \
libgtkglext1 \ libxml2 \
libnspr4 \ libxss1 \
libnss3 \ libxtst6 \
libnss3-nssdb \ nano \
libstdc++6 \ net-tools \
libxml2 \ netcat \
libxss1 \ nginx-extras \
libxtst6 \ nodejs \
nano \ postgresql \
nginx-extras \ postgresql-client \
nodejs \ pwgen \
postgresql \ rabbitmq-server \
postgresql-client \ redis-server \
pwgen \ software-properties-common \
rabbitmq-server \ sudo \
redis-server \ supervisor \
software-properties-common \ xvfb \
supervisor \ zlib1g && \
ttf-mscorefonts-installer \
xvfb \
zlib1g && \
[ $(ls -l /usr/share/fonts/truetype/msttcorefonts | wc -l) -eq 61 ] && \
sudo -u postgres psql -c "CREATE DATABASE onlyoffice;" && \ sudo -u postgres psql -c "CREATE DATABASE onlyoffice;" && \
sudo -u postgres psql -c "CREATE USER onlyoffice WITH password '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 "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;" && \
@ -68,7 +63,7 @@ ARG PRODUCT_NAME=onlyoffice-documentserver
RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/onlyoffice.list && \ RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/onlyoffice.list && \
apt-get -y update && \ apt-get -y update && \
service postgresql start && \ service postgresql start && \
apt-get --force-yes -yq install $PRODUCT_NAME && \ apt-get --allow-unauthenticated -yq install $PRODUCT_NAME && \
service postgresql stop && \ service postgresql stop && \
service supervisor stop && \ service supervisor stop && \
chmod 755 /app/onlyoffice/*.sh && \ chmod 755 /app/onlyoffice/*.sh && \

@ -13,7 +13,6 @@
* [Installing ONLYOFFICE Document Server integrated with Community and Mail Servers](#installing-onlyoffice-document-server-integrated-with-community-and-mail-servers) * [Installing ONLYOFFICE Document Server integrated with Community and Mail Servers](#installing-onlyoffice-document-server-integrated-with-community-and-mail-servers)
* [Issues](#issues) * [Issues](#issues)
- [Docker Issues](#docker-issues) - [Docker Issues](#docker-issues)
- [Mono Issues](#mono-issues)
* [Project Information](#project-information) * [Project Information](#project-information)
* [User Feedback and Support](#user-feedback-and-support) * [User Feedback and Support](#user-feedback-and-support)
@ -282,11 +281,6 @@ As a relatively new project Docker is being worked on and actively developed by
The known Docker issue with ONLYOFFICE Document Server with rpm-based distributives is that sometimes the processes fail to start inside Docker container. Fedora and RHEL/CentOS users should try disabling selinux with setenforce 0. If it fixes the issue then you can either stick with SELinux disabled which is not recommended by RedHat, or switch to using Ubuntu. The known Docker issue with ONLYOFFICE Document Server with rpm-based distributives is that sometimes the processes fail to start inside Docker container. Fedora and RHEL/CentOS users should try disabling selinux with setenforce 0. If it fixes the issue then you can either stick with SELinux disabled which is not recommended by RedHat, or switch to using Ubuntu.
### Mono Issues
ONLYOFFICE installation requires the presence of mono (tested for version 3.12.1 or [older](http://www.mono-project.com/docs/getting-started/install/linux/#accessing-older-releases "older")) that may cause problems for some Linux kernel versions. The full list of supported kernel versions is available [here](http://onlyo.co/1PABPEI "here").
## Project Information ## Project Information
Official website: [http://www.onlyoffice.org](http://onlyoffice.org "http://www.onlyoffice.org") Official website: [http://www.onlyoffice.org](http://onlyoffice.org "http://www.onlyoffice.org")

@ -22,9 +22,10 @@ ONLYOFFICE_HTTPS_HSTS_MAXAGE=${ONLYOFFICE_HTTPS_HSTS_MAXAGE:-31536000}
SYSCONF_TEMPLATES_DIR="/app/onlyoffice/setup/config" SYSCONF_TEMPLATES_DIR="/app/onlyoffice/setup/config"
NGINX_CONFD_PATH="/etc/nginx/conf.d"; NGINX_CONFD_PATH="/etc/nginx/conf.d";
NGINX_ONLYOFFICE_PATH="${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf"; NGINX_ONLYOFFICE_CONF="${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf"
NGINX_ONLYOFFICE_INCLUDES_PATH="/etc/nginx/includes"; NGINX_ONLYOFFICE_PATH="${CONF_DIR}/nginx"
NGINX_ONLYOFFICE_EXAMPLE_PATH=${NGINX_ONLYOFFICE_INCLUDES_PATH}/onlyoffice-documentserver-example.conf NGINX_ONLYOFFICE_EXAMPLE_PATH="${CONF_DIR}-example/nginx"
NGINX_ONLYOFFICE_EXAMPLE_CONF="${NGINX_ONLYOFFICE_EXAMPLE_PATH}/includes/onlyoffice-documentserver-example.conf"
NGINX_CONFIG_PATH="/etc/nginx/nginx.conf" NGINX_CONFIG_PATH="/etc/nginx/nginx.conf"
NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1}
@ -44,7 +45,7 @@ JSON_EXAMPLE="json -q -f ${ONLYOFFICE_EXAMPLE_CONFIG}"
LOCAL_SERVICES=() LOCAL_SERVICES=()
PG_VERSION=9.3 PG_VERSION=9.5
PG_NAME=main PG_NAME=main
PGDATA=/var/lib/postgresql/${PG_VERSION}/${PG_NAME} PGDATA=/var/lib/postgresql/${PG_VERSION}/${PG_NAME}
PG_NEW_CLUSTER=false PG_NEW_CLUSTER=false
@ -207,36 +208,39 @@ update_nginx_settings(){
# setup HTTPS # setup HTTPS
if [ -f "${SSL_CERTIFICATE_PATH}" -a -f "${SSL_KEY_PATH}" ]; then if [ -f "${SSL_CERTIFICATE_PATH}" -a -f "${SSL_KEY_PATH}" ]; then
cp ${NGINX_CONFD_PATH}/onlyoffice-documentserver-ssl.conf.template ${NGINX_ONLYOFFICE_PATH} ln -sf ${NGINX_ONLYOFFICE_PATH}/onlyoffice-documentserver-ssl.conf.template ${NGINX_ONLYOFFICE_CONF}
# configure nginx # configure nginx
sed 's,{{SSL_CERTIFICATE_PATH}},'"${SSL_CERTIFICATE_PATH}"',' -i ${NGINX_ONLYOFFICE_PATH} sed 's,{{SSL_CERTIFICATE_PATH}},'"${SSL_CERTIFICATE_PATH}"',' -i ${NGINX_ONLYOFFICE_CONF}
sed 's,{{SSL_KEY_PATH}},'"${SSL_KEY_PATH}"',' -i ${NGINX_ONLYOFFICE_PATH} sed 's,{{SSL_KEY_PATH}},'"${SSL_KEY_PATH}"',' -i ${NGINX_ONLYOFFICE_CONF}
# turn on http2
sed 's,\(443 ssl\),\1 http2,' -i ${NGINX_ONLYOFFICE_CONF}
# if dhparam path is valid, add to the config, otherwise remove the option # if dhparam path is valid, add to the config, otherwise remove the option
if [ -r "${SSL_DHPARAM_PATH}" ]; then if [ -r "${SSL_DHPARAM_PATH}" ]; then
sed 's,\(\#* *\)\?\(ssl_dhparam \).*\(;\)$,'"\2${SSL_DHPARAM_PATH}\3"',' -i ${NGINX_ONLYOFFICE_PATH} sed 's,\(\#* *\)\?\(ssl_dhparam \).*\(;\)$,'"\2${SSL_DHPARAM_PATH}\3"',' -i ${NGINX_ONLYOFFICE_CONF}
else else
sed '/ssl_dhparam/d' -i ${NGINX_ONLYOFFICE_PATH} sed '/ssl_dhparam/d' -i ${NGINX_ONLYOFFICE_CONF}
fi fi
sed 's,\(ssl_verify_client \).*\(;\)$,'"\1${SSL_VERIFY_CLIENT}\2"',' -i ${NGINX_ONLYOFFICE_PATH} sed 's,\(ssl_verify_client \).*\(;\)$,'"\1${SSL_VERIFY_CLIENT}\2"',' -i ${NGINX_ONLYOFFICE_CONF}
if [ -f "${CA_CERTIFICATES_PATH}" ]; then if [ -f "${CA_CERTIFICATES_PATH}" ]; then
sed '/ssl_verify_client/a '"ssl_client_certificate ${CA_CERTIFICATES_PATH}"';' -i ${NGINX_ONLYOFFICE_PATH} sed '/ssl_verify_client/a '"ssl_client_certificate ${CA_CERTIFICATES_PATH}"';' -i ${NGINX_ONLYOFFICE_CONF}
fi fi
if [ "${ONLYOFFICE_HTTPS_HSTS_ENABLED}" == "true" ]; then if [ "${ONLYOFFICE_HTTPS_HSTS_ENABLED}" == "true" ]; then
sed 's,\(max-age=\).*\(;\)$,'"\1${ONLYOFFICE_HTTPS_HSTS_MAXAGE}\2"',' -i ${NGINX_ONLYOFFICE_PATH} sed 's,\(max-age=\).*\(;\)$,'"\1${ONLYOFFICE_HTTPS_HSTS_MAXAGE}\2"',' -i ${NGINX_ONLYOFFICE_CONF}
else else
sed '/max-age=/d' -i ${NGINX_ONLYOFFICE_PATH} sed '/max-age=/d' -i ${NGINX_ONLYOFFICE_CONF}
fi fi
else else
cp ${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf.template ${NGINX_ONLYOFFICE_PATH} ln -sf ${NGINX_ONLYOFFICE_PATH}/onlyoffice-documentserver.conf.template ${NGINX_ONLYOFFICE_CONF}
fi fi
if [ -f "${NGINX_ONLYOFFICE_EXAMPLE_PATH}" ]; then if [ -f "${NGINX_ONLYOFFICE_EXAMPLE_CONF}" ]; then
sed 's/linux/docker/' -i ${NGINX_ONLYOFFICE_EXAMPLE_PATH} sed 's/linux/docker/' -i ${NGINX_ONLYOFFICE_EXAMPLE_CONF}
fi fi
} }
@ -332,3 +336,4 @@ service nginx start
# Regenerate the fonts list and the fonts thumbnails # Regenerate the fonts list and the fonts thumbnails
documentserver-generate-allfonts.sh ${ONLYOFFICE_DATA_CONTAINER} documentserver-generate-allfonts.sh ${ONLYOFFICE_DATA_CONTAINER}
documentserver-static-gzip.sh ${ONLYOFFICE_DATA_CONTAINER}