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

View file

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

View file

@ -13,7 +13,6 @@
* [Installing ONLYOFFICE Document Server integrated with Community and Mail Servers](#installing-onlyoffice-document-server-integrated-with-community-and-mail-servers)
* [Issues](#issues)
- [Docker Issues](#docker-issues)
- [Mono Issues](#mono-issues)
* [Project Information](#project-information)
* [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.
### 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
Official website: [http://www.onlyoffice.org](http://onlyoffice.org "http://www.onlyoffice.org")

View file

@ -22,9 +22,10 @@ ONLYOFFICE_HTTPS_HSTS_MAXAGE=${ONLYOFFICE_HTTPS_HSTS_MAXAGE:-31536000}
SYSCONF_TEMPLATES_DIR="/app/onlyoffice/setup/config"
NGINX_CONFD_PATH="/etc/nginx/conf.d";
NGINX_ONLYOFFICE_PATH="${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf";
NGINX_ONLYOFFICE_INCLUDES_PATH="/etc/nginx/includes";
NGINX_ONLYOFFICE_EXAMPLE_PATH=${NGINX_ONLYOFFICE_INCLUDES_PATH}/onlyoffice-documentserver-example.conf
NGINX_ONLYOFFICE_CONF="${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf"
NGINX_ONLYOFFICE_PATH="${CONF_DIR}/nginx"
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_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1}
@ -44,7 +45,7 @@ JSON_EXAMPLE="json -q -f ${ONLYOFFICE_EXAMPLE_CONFIG}"
LOCAL_SERVICES=()
PG_VERSION=9.3
PG_VERSION=9.5
PG_NAME=main
PGDATA=/var/lib/postgresql/${PG_VERSION}/${PG_NAME}
PG_NEW_CLUSTER=false
@ -207,36 +208,39 @@ update_nginx_settings(){
# setup HTTPS
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
sed 's,{{SSL_CERTIFICATE_PATH}},'"${SSL_CERTIFICATE_PATH}"',' -i ${NGINX_ONLYOFFICE_PATH}
sed 's,{{SSL_KEY_PATH}},'"${SSL_KEY_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_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 [ -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
sed '/ssl_dhparam/d' -i ${NGINX_ONLYOFFICE_PATH}
sed '/ssl_dhparam/d' -i ${NGINX_ONLYOFFICE_CONF}
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
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
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
sed '/max-age=/d' -i ${NGINX_ONLYOFFICE_PATH}
sed '/max-age=/d' -i ${NGINX_ONLYOFFICE_CONF}
fi
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
if [ -f "${NGINX_ONLYOFFICE_EXAMPLE_PATH}" ]; then
sed 's/linux/docker/' -i ${NGINX_ONLYOFFICE_EXAMPLE_PATH}
if [ -f "${NGINX_ONLYOFFICE_EXAMPLE_CONF}" ]; then
sed 's/linux/docker/' -i ${NGINX_ONLYOFFICE_EXAMPLE_CONF}
fi
}
@ -332,3 +336,4 @@ service nginx start
# Regenerate the fonts list and the fonts thumbnails
documentserver-generate-allfonts.sh ${ONLYOFFICE_DATA_CONTAINER}
documentserver-static-gzip.sh ${ONLYOFFICE_DATA_CONTAINER}