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
b9f9ed6b
Commit
b9f9ed6b
authored
8 years ago
by
Alexey Golubev
Browse files
Options
Downloads
Patches
Plain Diff
mysql -> postgresql
parent
4859e8f4
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+8
-5
8 additions, 5 deletions
Dockerfile
docker-compose.yml
+13
-14
13 additions, 14 deletions
docker-compose.yml
run-document-server.sh
+33
-27
33 additions, 27 deletions
run-document-server.sh
with
54 additions
and
46 deletions
Dockerfile
+
8
−
5
View file @
b9f9ed6b
...
...
@@ -5,19 +5,22 @@ ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=nonint
RUN
echo
"#!/bin/sh
\n
exit 0"
>
/usr/sbin/policy-rc.d
&&
\
apt-get
-y
update
&&
\
apt-get
--force-yes
-yq
install
apt-transport-https
&&
\
apt-get
--force-yes
-yq
install
wget
apt-transport-https
&&
\
apt-key adv
--keyserver
keyserver.ubuntu.com
--recv-keys
D9D0BF019CC8AC0D
&&
\
apt-key adv
--keyserver
keyserver.ubuntu.com
--recv-keys
1655A0AB68576280
&&
\
wget https://www.postgresql.org/media/keys/ACCC4CF8.asc
&&
\
apt-key add ACCC4CF8.asc
&&
\
echo
"deb http://archive.ubuntu.com/ubuntu precise main universe multiverse"
>>
/etc/apt/sources.list
&&
\
echo
"deb https://deb.nodesource.com/node_4.x trusty main"
|
tee
/etc/apt/sources.list.d/nodesource.list
&&
\
echo
"deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main"
|
tee
/etc/apt/sources.list.d/nodesource.list
&&
\
locale-gen en_US.UTF-8
&&
\
apt-get
-y
update
&&
\
echo
ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula
select
true
| debconf-set-selections
&&
\
apt-get
install
--force-yes
-yq
software-properties-common
&&
\
add-apt-repository ppa:ubuntu-toolchain-r/test
&&
\
apt-get
-y
update
&&
\
apt-get
--force-yes
-yq
install
software-properties-common adduser
mysql-server
redis-server rabbitmq-server nginx-extras nodejs libstdc++6 libcurl3 libxml2 libboost-regex-dev zlib1g supervisor fonts-dejavu fonts-liberation ttf-mscorefonts-installer fonts-crosextra-carlito fonts-takao-gothic fonts-opensymbol libxss1 libgtkglext1 libcairo2 xvfb libxtst6 libgconf2-4 libasound2 bomstrip libnspr4 libnss3 libnss3-nssdb nano htop
&&
\
service
my
sql stop
&&
\
apt-get
--force-yes
-yq
install
software-properties-common adduser
postgresql
redis-server rabbitmq-server nginx-extras nodejs libstdc++6 libcurl3 libxml2 libboost-regex-dev zlib1g supervisor fonts-dejavu fonts-liberation ttf-mscorefonts-installer fonts-crosextra-carlito fonts-takao-gothic fonts-opensymbol libxss1 libgtkglext1 libcairo2 xvfb libxtst6 libgconf2-4 libasound2 bomstrip libnspr4 libnss3 libnss3-nssdb nano htop
&&
\
service
postgre
sql stop
&&
\
service redis-server stop
&&
\
service rabbitmq-server stop
&&
\
service supervisor stop
&&
\
...
...
@@ -31,9 +34,9 @@ EXPOSE 80 443
RUN
echo
"deb http://repo-doc-onlyoffice-com.s3.amazonaws.com/ubuntu/trusty/onlyoffice-documentserver/{{GIT_BRANCH}}/{{PACKAGE_VERSION}}/ repo/"
|
tee
/etc/apt/sources.list.d/onlyoffice.list
&&
\
apt-get
-y
update
&&
\
service
my
sql start
&&
\
service
postgre
sql start
&&
\
apt-get
--force-yes
-yq
install
onlyoffice-documentserver
&&
\
service
my
sql stop
&&
\
service
postgre
sql stop
&&
\
service supervisor stop
&&
\
chmod
755 /app/onlyoffice/
*
.sh
&&
\
rm
-rf
/var/log/onlyoffice
&&
\
...
...
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
13
−
14
View file @
b9f9ed6b
...
...
@@ -5,10 +5,10 @@ services:
image
:
onlyoffice/4testing-documentserver:latest
environment
:
-
ONLYOFFICE_DATA_CONTAINER=true
-
MY
SQL_SERVER_HOST=onlyoffice-
mysql
-
MY
SQL_SERVER_PORT=
3306
-
MY
SQL_SERVER_DB_NAME=onlyoffice
-
MY
SQL_SERVER_USER=root
-
POSTGRE
SQL_SERVER_HOST=onlyoffice-
postgers
-
POSTGRE
SQL_SERVER_PORT=
5432
-
POSTGRE
SQL_SERVER_DB_NAME=onlyoffice
-
POSTGRE
SQL_SERVER_USER=root
-
RABBITMQ_SERVER_HOST=onlyoffice-rabbitmq
-
RABBITMQ_SERVER_USER=guest
-
RABBITMQ_SERVER_PASS=guest
...
...
@@ -29,7 +29,7 @@ services:
image
:
onlyoffice/4testing-documentserver:latest
depends_on
:
-
onlyoffice-documentserver-data
-
onlyoffice-
my
sql
-
onlyoffice-
postgre
sql
-
onlyoffice-redis
-
onlyoffice-rabbitmq
environment
:
...
...
@@ -92,24 +92,23 @@ services:
expose
:
-
'
5672'
onlyoffice-
my
sql
:
container_name
:
onlyoffice-
my
sql
image
:
mysql:5
.5
onlyoffice-
postgre
sql
:
container_name
:
onlyoffice-
postgre
sql
image
:
postgres:9
.5
environment
:
-
MYSQL_DATABASE=onlyoffice
-
MYSQL_USER=root
-
MYSQL_ALLOW_EMPTY_PASSWORD='true'
-
POSTGRES_DB=onlyoffice
-
POSTGRES_USER=onlyoffice
networks
:
-
onlyoffice
restart
:
always
expose
:
-
'
3306
'
-
'
5432
'
volumes
:
-
my
sql_data:/var/lib/
my
sql
-
postgre
sql_data:/var/lib/
postgre
sql
networks
:
onlyoffice
:
driver
:
'
bridge'
volumes
:
my
sql_data
:
postgre
sql_data
:
This diff is collapsed.
Click to expand it.
run-document-server.sh
+
33
−
27
View file @
b9f9ed6b
...
...
@@ -31,11 +31,11 @@ JSON="json -q -f ${ONLYOFFICE_DEFAULT_CONFIG}"
LOCAL_SERVICES
=()
read_setting
(){
MY
SQL_SERVER_HOST
=
${
MY
SQL_SERVER_HOST
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbHost
)
}
MY
SQL_SERVER_PORT
=
${
MY
SQL_SERVER_PORT
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbPort
)
}
MY
SQL_SERVER_DB_NAME
=
${
MY
SQL_SERVER_DB_NAME
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbName
)
}
MY
SQL_SERVER_USER
=
${
MY
SQL_SERVER_USER
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbUser
)
}
MY
SQL_SERVER_PASS
=
${
MY
SQL_SERVER_PASS
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbPass
)
}
POSTGRE
SQL_SERVER_HOST
=
${
POSTGRE
SQL_SERVER_HOST
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbHost
)
}
POSTGRE
SQL_SERVER_PORT
=
${
POSTGRE
SQL_SERVER_PORT
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbPort
)
}
POSTGRE
SQL_SERVER_DB_NAME
=
${
POSTGRE
SQL_SERVER_DB_NAME
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbName
)
}
POSTGRE
SQL_SERVER_USER
=
${
POSTGRE
SQL_SERVER_USER
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbUser
)
}
POSTGRE
SQL_SERVER_PASS
=
${
POSTGRE
SQL_SERVER_PASS
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbPass
)
}
RABBITMQ_SERVER_URL
=
$(
${
JSON
}
rabbitmq.url
)
RABBITMQ_SERVER_HOST
=
${
RABBITMQ_SERVER_HOST
:-${
RABBITMQ_SERVER_URL
#
'amqp://'
}}
...
...
@@ -54,8 +54,8 @@ waiting_for_connection(){
done
}
waiting_for_
my
sql
(){
waiting_for_connection
${
MY
SQL_SERVER_HOST
}
${
MY
SQL_SERVER_PORT
}
waiting_for_
postgre
sql
(){
waiting_for_connection
${
POSTGRE
SQL_SERVER_HOST
}
${
POSTGRE
SQL_SERVER_PORT
}
}
waiting_for_rabbitmq
(){
...
...
@@ -68,12 +68,12 @@ waiting_for_redis(){
waiting_for_datacontainer
(){
waiting_for_connection
${
ONLYOFFICE_DATA_CONTAINER_HOST
}
${
ONLYOFFICE_DATA_CONTAINER_PORT
}
}
update_
my
sql_settings
(){
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbHost = '
${
MY
SQL_SERVER_HOST
}
'"
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbPort = '
${
MY
SQL_SERVER_PORT
}
'"
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbName = '
${
MY
SQL_SERVER_DB_NAME
}
'"
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbUser = '
${
MY
SQL_SERVER_USER
}
'"
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbPass = '
${
MY
SQL_SERVER_PASS
}
'"
update_
postgre
sql_settings
(){
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbHost = '
${
POSTGRE
SQL_SERVER_HOST
}
'"
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbPort = '
${
POSTGRE
SQL_SERVER_PORT
}
'"
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbName = '
${
POSTGRE
SQL_SERVER_DB_NAME
}
'"
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbUser = '
${
POSTGRE
SQL_SERVER_USER
}
'"
${
JSON
}
-I
-e
"this.services.CoAuthoring.sql.dbPass = '
${
POSTGRE
SQL_SERVER_PASS
}
'"
}
update_rabbitmq_setting
(){
...
...
@@ -87,15 +87,21 @@ update_redis_settings(){
${
JSON
}
-I
-e
"this.services.CoAuthoring.redis.port = '
${
REDIS_SERVER_PORT
}
'"
}
create_
my
sql_db
(){
MYSQL
=
"mysql -s -h
${
MY
SQL_SERVER_HOST
}
-
u
${
MY
SQL_SERVER_USER
}
"
if
[
-n
"
${
MY
SQL_SERVER_PASS
}
"
]
;
then
MYSQL
=
"
$MYSQL
-p
${
MY
SQL_SERVER_PASS
}
"
create_
postgre
sql_db
(){
CONNECTION_PARAMS
=
"-h
${
POSTGRE
SQL_SERVER_HOST
}
-
U
${
POSTGRE
SQL_SERVER_USER
}
-w
"
if
[
-n
"
${
POSTGRE
SQL_SERVER_PASS
}
"
]
;
then
export
PGPASSWORD
=
${
POSTGRE
SQL_SERVER_PASS
}
fi
PSQL
=
"psql -q
$CONNECTION_PARAMS
"
CREATEDB
=
"createdb
$CONNECTION_PARAMS
"
# 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"
if
$PSQL
-lt
|
cut
-d
\|
-f
1 |
grep
-qw
|
grep
0
;
then
$CREATEDB
$DB_NAME
fi
$PSQL
-d
"
${
POSTGRESQL_SERVER_DB_NAME
}
"
-f
"
${
APP_DIR
}
/server/schema/postgresql/createdb.sql"
}
update_nginx_settings
(){
...
...
@@ -156,12 +162,12 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then
read_setting
# update settings by env variables
if
[
${
MY
SQL_SERVER_HOST
}
!=
"localhost"
]
;
then
update_
my
sql_settings
waiting_for_
my
sql
create_
my
sql_db
if
[
${
POSTGRE
SQL_SERVER_HOST
}
!=
"localhost"
]
;
then
update_
postgre
sql_settings
waiting_for_
postgre
sql
create_
postgre
sql_db
else
LOCAL_SERVICES+
=(
"
my
sql"
)
LOCAL_SERVICES+
=(
"
postgre
sql"
)
fi
if
[
${
RABBITMQ_SERVER_HOST
}
!=
"localhost"
]
;
then
...
...
@@ -190,7 +196,7 @@ for i in ${LOCAL_SERVICES[@]}; do
done
if
[
${
ONLYOFFICE_DATA_CONTAINER
}
!=
"true"
]
;
then
waiting_for_
my
sql
waiting_for_
postgre
sql
waiting_for_rabbitmq
waiting_for_redis
...
...
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