Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
docker-onlyoffice-documentserver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TO
docker-onlyoffice-documentserver
Commits
89de48c8
Commit
89de48c8
authored
8 years ago
by
Alexey.Golubev
Browse files
Options
Downloads
Patches
Plain Diff
added data container for onlyoffice-documentserver
parent
0fa55f01
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
docker-compose.yml
+26
-16
26 additions, 16 deletions
docker-compose.yml
run-document-server.sh
+141
-91
141 additions, 91 deletions
run-document-server.sh
with
167 additions
and
107 deletions
docker-compose.yml
+
26
−
16
View file @
89de48c8
version
:
'
2'
version
:
'
2'
services
:
services
:
onlyoffice-document
:
onlyoffice-documentserver-data
:
container_name
:
onlyoffice-documentserver-data
image
:
onlyoffice/4testing-documentserver:latest
image
:
onlyoffice/4testing-documentserver:latest
depends_on
:
-
onlyoffice-mysql
-
onlyoffice-redis
-
onlyoffice-rabbitmq
environment
:
environment
:
-
MYSQL_SERVER_HOST=onlyoffice-mysql
-
MYSQL_SERVER_HOST=onlyoffice-mysql
-
MYSQL_SERVER_PORT=3306
-
MYSQL_SERVER_PORT=3306
...
@@ -16,6 +13,26 @@ services:
...
@@ -16,6 +13,26 @@ services:
-
RABBITMQ_SERVER_PASS=guest
-
RABBITMQ_SERVER_PASS=guest
-
REDIS_SERVER_HOST=onlyoffice-redis
-
REDIS_SERVER_HOST=onlyoffice-redis
-
REDIS_SERVER_PORT=6379
-
REDIS_SERVER_PORT=6379
stdin_open
:
true
tty
:
true
restart
:
always
networks
:
-
onlyoffice
volumes
:
-
/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/4testing-documentserver:latest
depends_on
:
-
onlyoffice-documentserver-data
-
onlyoffice-mysql
-
onlyoffice-redis
-
onlyoffice-rabbitmq
environment
:
-
HTTP_CHECK=HEAD /healthcheck
-
HTTP_CHECK=HEAD /healthcheck
-
EXTRA_SETTINGS=http-check expect status
200
-
EXTRA_SETTINGS=http-check expect status
200
stdin_open
:
true
stdin_open
:
true
...
@@ -26,24 +43,21 @@ services:
...
@@ -26,24 +43,21 @@ services:
expose
:
expose
:
-
'
80'
-
'
80'
-
'
443'
-
'
443'
volumes
:
volumes_from
:
-
document_data:/var/www/onlyoffice/Data
-
onlyoffice-documentserver-data
:
-
document_log:/var/log/onlyoffice
-
document_files:/var/lib/onlyoffice/documentserver/App_Data/cache/files
-
document_example_files:/var/www/onlyoffice/documentserver-example/public/files
onlyoffice-haproxy
:
onlyoffice-haproxy
:
container_name
:
onlyoffice-haproxy
container_name
:
onlyoffice-haproxy
image
:
dockercloud/haproxy:1.2.1
image
:
dockercloud/haproxy:1.2.1
depends_on
:
depends_on
:
-
onlyoffice-document
-
onlyoffice-document
server
environment
:
environment
:
-
MODE=tcp
-
MODE=tcp
-
TCP_PORTS="80, 443"
-
TCP_PORTS="80, 443"
stdin_open
:
true
stdin_open
:
true
tty
:
true
tty
:
true
links
:
links
:
-
onlyoffice-document
-
onlyoffice-document
server
volumes
:
volumes
:
-
/var/run/docker.sock:/var/run/docker.sock
-
/var/run/docker.sock:/var/run/docker.sock
restart
:
always
restart
:
always
...
@@ -93,7 +107,3 @@ networks:
...
@@ -93,7 +107,3 @@ networks:
volumes
:
volumes
:
mysql_data
:
mysql_data
:
document_data
:
document_log
:
document_files
:
document_example_files
:
This diff is collapsed.
Click to expand it.
run-document-server.sh
+
141
−
91
View file @
89de48c8
...
@@ -4,7 +4,7 @@ APP_DIR="/var/www/onlyoffice/documentserver"
...
@@ -4,7 +4,7 @@ APP_DIR="/var/www/onlyoffice/documentserver"
DATA_DIR
=
"/var/www/onlyoffice/Data"
DATA_DIR
=
"/var/www/onlyoffice/Data"
LOG_DIR
=
"/var/log/onlyoffice/documentserver"
LOG_DIR
=
"/var/log/onlyoffice/documentserver"
ONLYOFFICE_
HTTPS
=
${
ONLYOFFICE_HTTPS
:-
false
}
ONLYOFFICE_
DATA_CONTAINER
=
${
ONLYOFFICE_DATA_CONTAINER
:-
false
}
SSL_CERTIFICATES_DIR
=
"
${
DATA_DIR
}
/certs"
SSL_CERTIFICATES_DIR
=
"
${
DATA_DIR
}
/certs"
SSL_CERTIFICATE_PATH
=
${
SSL_CERTIFICATE_PATH
:-${
SSL_CERTIFICATES_DIR
}
/onlyoffice.crt
}
SSL_CERTIFICATE_PATH
=
${
SSL_CERTIFICATE_PATH
:-${
SSL_CERTIFICATES_DIR
}
/onlyoffice.crt
}
...
@@ -24,26 +24,73 @@ NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)}
...
@@ -24,26 +24,73 @@ NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)}
ONLYOFFICE_DEFAULT_CONFIG
=
/etc/onlyoffice/documentserver/default.json
ONLYOFFICE_DEFAULT_CONFIG
=
/etc/onlyoffice/documentserver/default.json
MYSQL_SERVER_HOST
=
${
MYSQL_SERVER_HOST
:-
"localhost"
}
JSON
=
"json -q -f
${
ONLYOFFICE_DEFAULT_CONFIG
}
"
MYSQL_SERVER_PORT
=
${
MYSQL_SERVER_PORT
:-
"3306"
}
MYSQL_SERVER_DB_NAME
=
${
MYSQL_SERVER_DB_NAME
:-
"onlyoffice"
}
MYSQL_SERVER_USER
=
${
MYSQL_SERVER_USER
:-
"root"
}
MYSQL_SERVER_PASS
=
${
MYSQL_SERVER_PASS
:-
""
}
RABBITMQ_SERVER_HOST
=
${
RABBITMQ_SERVER_HOST
:-
"localhost"
}
MYSQL_SERVER_HOST
=
${
MYSQL_SERVER_HOST
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbHost
)
}
RABBITMQ_SERVER_USER
=
${
RABBITMQ_SERVER_USER
:-
"guest"
}
MYSQL_SERVER_PORT
=
${
MYSQL_SERVER_PORT
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbPort
)
}
RABBITMQ_SERVER_PASS
=
${
RABBITMQ_SERVER_PASS
:-
"guest"
}
MYSQL_SERVER_DB_NAME
=
${
MYSQL_SERVER_DB_NAME
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbName
)
}
MYSQL_SERVER_USER
=
${
MYSQL_SERVER_USER
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbUser
)
}
MYSQL_SERVER_PASS
=
${
MYSQL_SERVER_PASS
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbPass
)
}
REDIS_SERVER_HOST
=
${
REDIS_SERVER_HOST
:-
"localhost"
}
RABBITMQ_SERVER_URL
=
$(
${
JSON
}
rabbitmq.url
)
REDIS_SERVER_PORT
=
${
REDIS_SERVER_PORT
:-
"6379"
}
RABBITMQ_SERVER_HOST
=
${
RABBITMQ_SERVER_HOST
:-${
RABBITMQ_SERVER_URL
#
'amqp://'
}}
RABBITMQ_SERVER_USER
=
${
RABBITMQ_SERVER_USER
:-
$(
${
JSON
}
rabbitmq.login
)
}
RABBITMQ_SERVER_PASS
=
${
RABBITMQ_SERVER_PASS
:-
$(
${
JSON
}
rabbitmq.password
)
}
RABBITMQ_SERVER_PORT
=
${
RABBITMQ_SERVER_PORT
:-
"5672"
}
# create base folders
REDIS_SERVER_HOST
=
${
REDIS_SERVER_HOST
:-
$(
${
JSON
}
services.CoAuthoring.redis.host
)
}
for
i
in
converter docservice spellchecker metrics gc
;
do
REDIS_SERVER_PORT
=
${
REDIS_SERVER_PORT
:-
$(
${
JSON
}
services.CoAuthoring.redis.port
)
}
mkdir
-p
"
${
LOG_DIR
}
/
$i
"
waiting_for_connection
(){
until
nc
-z
-w
3
"
$1
"
"
$2
"
;
do
>
&2
echo
"Waiting for connection to the
$1
host on port
$2
"
sleep
1
done
done
}
waiting_for_mysql
(){
waiting_for_connection
${
MYSQL_SERVER_HOST
}
${
MYSQL_SERVER_PORT
}
}
waiting_for_rabbitmq
(){
waiting_for_connection
${
RABBITMQ_SERVER_HOST
}
${
RABBITMQ_SERVER_PORT
}
}
waiting_for_redis
(){
waiting_for_connection
${
REDIS_SERVER_HOST
}
${
REDIS_SERVER_PORT
}
}
update_mysql_settings
(){
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbHost = '
${
MYSQL_SERVER_HOST
}
'"
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbPort = '
${
MYSQL_SERVER_PORT
}
'"
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbName = '
${
MYSQL_SERVER_DB_NAME
}
'"
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbUser = '
${
MYSQL_SERVER_USER
}
'"
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbPass = '
${
MYSQL_SERVER_PASS
}
'"
}
update_rabbitmq_setting
(){
${
JSON
}
-I
-e
"this.rabbitmq.url = 'amqp://
${
RABBITMQ_SERVER_HOST
}
'"
${
JSON
}
-I
-e
"this.rabbitmq.login = '
${
RABBITMQ_SERVER_USER
}
'"
${
JSON
}
-I
-e
"this.rabbitmq.password = '
${
RABBITMQ_SERVER_PASS
}
'"
}
update_redis_settings
(){
${
JSON
}
-I
-e
"this.services.CoAuthoring.redis.host = '
${
REDIS_SERVER_HOST
}
'"
${
JSON
}
-I
-e
"this.services.CoAuthoring.redis.port = '
${
REDIS_SERVER_PORT
}
'"
}
create_mysql_db
(){
MYSQL
=
"mysql -s -h
${
MYSQL_SERVER_HOST
}
-u
${
MYSQL_SERVER_USER
}
"
if
[
-n
"
${
MYSQL_SERVER_PASS
}
"
]
;
then
MYSQL
=
"
$MYSQL
-p
${
MYSQL_SERVER_PASS
}
"
fi
mkdir
-p
${
LOG_DIR
}
-example
# Create db on remote server
${
MYSQL
}
-e
"CREATE DATABASE IF NOT EXISTS
${
MYSQL_SERVER_DB_NAME
}
CHARACTER SET utf8 COLLATE 'utf8_general_ci';"
${
MYSQL
}
"
${
MYSQL_SERVER_DB_NAME
}
"
<
"
${
APP_DIR
}
/server/schema/createdb.sql"
}
start_nginx
(){
# Set up nginx
# Set up nginx
sed
's/^worker_processes.*/'
"worker_processes
${
NGINX_WORKER_PROCESSES
}
;"
'/'
-i
${
NGINX_CONFIG_PATH
}
sed
's/^worker_processes.*/'
"worker_processes
${
NGINX_WORKER_PROCESSES
}
;"
'/'
-i
${
NGINX_CONFIG_PATH
}
sed
's/worker_connections.*/'
"worker_connections
${
NGINX_WORKER_CONNECTIONS
}
;"
'/'
-i
${
NGINX_CONFIG_PATH
}
sed
's/worker_connections.*/'
"worker_connections
${
NGINX_WORKER_CONNECTIONS
}
;"
'/'
-i
${
NGINX_CONFIG_PATH
}
...
@@ -83,57 +130,60 @@ else
...
@@ -83,57 +130,60 @@ else
cp
${
SYSCONF_TEMPLATES_DIR
}
/nginx/onlyoffice-documentserver.conf
${
NGINX_ONLYOFFICE_PATH
}
cp
${
SYSCONF_TEMPLATES_DIR
}
/nginx/onlyoffice-documentserver.conf
${
NGINX_ONLYOFFICE_PATH
}
fi
fi
JSON
=
"json -I -q -f
${
ONLYOFFICE_DEFAULT_CONFIG
}
"
#start service
service nginx start
}
if
[
${
MYSQL_SERVER_HOST
}
!=
"localhost"
]
;
then
start_supervisor
(){
# Copy modified supervisor start script
cp
${
SYSCONF_TEMPLATES_DIR
}
/supervisor/supervisor /etc/init.d/
# Copy modified supervisor config
cp
${
SYSCONF_TEMPLATES_DIR
}
/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
# Change mysql settings
#start service
${
JSON
}
-e
"this.services.CoAuthoring.sql.dbHost = '
${
MYSQL_SERVER_HOST
}
'"
service supervisor start
${
JSON
}
-e
"this.services.CoAuthoring.sql.dbPort = '
${
MYSQL_SERVER_PORT
}
'"
}
${
JSON
}
-e
"this.services.CoAuthoring.sql.dbName = '
${
MYSQL_SERVER_DB_NAME
}
'"
${
JSON
}
-e
"this.services.CoAuthoring.sql.dbUser = '
${
MYSQL_SERVER_USER
}
'"
${
JSON
}
-e
"this.services.CoAuthoring.sql.dbPass = '
${
MYSQL_SERVER_PASS
}
'"
MYSQL
=
"mysql -s -h
${
MYSQL_SERVER_HOST
}
-u
${
MYSQL_SERVER_USER
}
"
# create base folders
if
[
-n
"
${
MYSQL_SERVER_PASS
}
"
]
;
then
for
i
in
converter docservice spellchecker metrics gc
;
do
MYSQL
=
"
$MYSQL
-p
${
MYSQL_SERVER_PASS
}
"
mkdir
-p
"
${
LOG_DIR
}
/
$i
"
fi
done
# Create db on remote server
mkdir
-p
${
LOG_DIR
}
-example
${
MYSQL
}
-e
"CREATE DATABASE IF NOT EXISTS
${
MYSQL_SERVER_DB_NAME
}
CHARACTER SET utf8 COLLATE 'utf8_general_ci';"
${
MYSQL
}
"
${
MYSQL_SERVER_DB_NAME
}
"
<
"
${
APP_DIR
}
/server/schema/createdb.sql"
if
[
${
MYSQL_SERVER_HOST
}
!=
"localhost"
]
;
then
update_mysql_settings
create_mysql_db
else
else
if
[
${
ONLYOFFICE_DATA_CONTAINER
}
!=
"true"
]
;
then
service mysql start
service mysql start
fi
fi
fi
if
[
${
RABBITMQ_SERVER_HOST
}
!=
"localhost"
]
;
then
if
[
${
RABBITMQ_SERVER_HOST
}
!=
"localhost"
]
;
then
update_rabbitmq_setting
# Change rabbitmq settings
${
JSON
}
-e
"this.rabbitmq.url = 'amqp://
${
RABBITMQ_SERVER_HOST
}
'"
${
JSON
}
-e
"this.rabbitmq.login = '
${
RABBITMQ_SERVER_USER
}
'"
${
JSON
}
-e
"this.rabbitmq.password = '
${
RABBITMQ_SERVER_PASS
}
'"
else
else
if
[
${
ONLYOFFICE_DATA_CONTAINER
}
!=
"true"
]
;
then
service redis-server start
service redis-server start
fi
fi
fi
if
[
${
REDIS_SERVER_HOST
}
!=
"localhost"
]
;
then
if
[
${
REDIS_SERVER_HOST
}
!=
"localhost"
]
;
then
update_redis_settings
# Change redis settings
${
JSON
}
-e
"this.services.CoAuthoring.redis.host = '
${
REDIS_SERVER_HOST
}
'"
${
JSON
}
-e
"this.services.CoAuthoring.redis.port = '
${
REDIS_SERVER_PORT
}
'"
else
else
if
[
${
ONLYOFFICE_DATA_CONTAINER
}
!=
"true"
]
;
then
service rabbitmq-server start
service rabbitmq-server start
fi
fi
fi
# Copy modified supervisor start script
if
[
${
ONLYOFFICE_DATA_CONTAINER
}
!=
"true"
]
;
then
cp
${
SYSCONF_TEMPLATES_DIR
}
/supervisor/supervisor /etc/init.d/
waiting_for_mysql
# Copy modified supervisor config
waiting_for_rabbitmq
cp
${
SYSCONF_TEMPLATES_DIR
}
/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
waiting_for_redis
service nginx start
start_nginx
service supervisor start
start_supervisor
fi
# Regenerate the fonts list and the fonts thumbnails
# Regenerate the fonts list and the fonts thumbnails
documentserver-generate-allfonts.sh
documentserver-generate-allfonts.sh
${
ONLYOFFICE_DATA_CONTAINER
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment