Skip to content
Snippets Groups Projects
Commit 05e4ba64 authored by Bruno Michel's avatar Bruno Michel
Browse files

Add a docker image for onlyoffice-dev

parent aea8dcf9
No related branches found
No related tags found
No related merge requests found
......@@ -45,8 +45,7 @@ docker run -it --rm --name cozy-stack \
We publish the cozy-app-dev image when we release a new version of the stack.
See `scripts/release.sh` for details.
## Docker run and url name
## Docker run and url name for cozy-app-dev
A precision for the app name:
......@@ -55,3 +54,18 @@ docker run --rm -it -p 8080:8080 -v "$(pwd)/build":/data/cozy-app/***my-app*** c
```
***my-app*** will be the first part of: ***my-app***.cozy.tools:8080
## Only-Office document server
The `cozy/onlyoffice-dev` docker image can be used for local development. Just start it with:
```bash
$ docker run -it --rm --name=oodev --net=host cozy/onlyoffice-dev
```
And if you need to rebuild it, you can do that with:
```bash
$ cd scripts/onlyoffice-dev
$ docker build -t "cozy/onlyoffice-dev" .
```
# Taken from https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/master/Dockerfile
FROM ubuntu:20.04
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 \
DEBIAN_FRONTEND=noninteractive \
PG_VERSION=12
COPY . /usr/bin/
RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
apt-get -y update && \
apt-get -yq install wget apt-utils apt-transport-https gnupg locales && \
locale-gen en_US.UTF-8 && \
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && \
apt-get -yq install \
adduser \
bomstrip \
certbot \
curl \
gconf-service \
htop \
libasound2 \
libboost-regex-dev \
libcairo2 \
libcurl3-gnutls \
libcurl4 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libstdc++6 \
libxml2 \
libxss1 \
libxtst6 \
mysql-client \
nano \
net-tools \
netcat-openbsd \
postgresql \
postgresql-client \
pwgen \
rabbitmq-server \
software-properties-common \
sudo \
ttf-mscorefonts-installer \
xvfb \
zlib1g && \
if [ $(ls -l /usr/share/fonts/truetype/msttcorefonts | wc -l) -ne 61 ]; \
then echo 'msttcorefonts failed to download'; exit 1; fi && \
echo "SERVER_ADDITIONAL_ERL_ARGS=\"+S 1:1\"" | tee -a /etc/rabbitmq/rabbitmq-env.conf && \
pg_conftool $PG_VERSION main set listen_addresses 'localhost' && \
service postgresql restart && \
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;" && \
echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | tee /etc/apt/sources.list.d/ds.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0x8320ca65cb2de8e5 && \
apt-get -y update && \
apt-get -yq install onlyoffice-documentserver && \
service postgresql stop && \
service rabbitmq-server stop && \
rm -rf /var/log/onlyoffice && \
rm -rf /var/lib/apt/lists/*
EXPOSE 8000
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
#!/bin/bash
set -eu
DATA_DIR="/var/www/onlyoffice/Data"
LIB_DIR="/var/lib/onlyoffice"
DS_LIB_DIR="${LIB_DIR}/documentserver"
# Create app folders
for i in ${DS_LIB_DIR}/App_Data/cache/files ${DS_LIB_DIR}/App_Data/docbuilder ${DS_LIB_DIR}-example/files; do
mkdir -p "$i"
done
# Change folder rights
for i in ${LIB_DIR} ${DATA_DIR}; do
chown -R ds:ds "$i"
chmod -R 755 "$i"
done
# Start services
service postgresql start
service rabbitmq-server start
# Ignore the error on restarting supervisord
documentserver-generate-allfonts.sh || true
# Start the document server
export NODE_ENV=production-linux
export NODE_CONFIG_DIR=/etc/onlyoffice/documentserver
export NODE_DISABLE_COLORS=1
cd /var/www/onlyoffice/documentserver/server/DocService
./docservice
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment