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
2fd40861
Commit
2fd40861
authored
8 years ago
by
Alexey.Golubev
Browse files
Options
Downloads
Patches
Plain Diff
Added /var/lib/postgresql volume
parent
89ad87d5
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
Dockerfile
+1
-1
1 addition, 1 deletion
Dockerfile
run-document-server.sh
+31
-1
31 additions, 1 deletion
run-document-server.sh
with
32 additions
and
2 deletions
Dockerfile
+
1
−
1
View file @
2fd40861
...
@@ -41,6 +41,6 @@ RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/onlyoffice.list && \
...
@@ -41,6 +41,6 @@ RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/onlyoffice.list && \
rm
-rf
/var/log/onlyoffice
&&
\
rm
-rf
/var/log/onlyoffice
&&
\
rm
-rf
/var/lib/apt/lists/
*
rm
-rf
/var/lib/apt/lists/
*
VOLUME
/etc/onlyoffice /var/log/onlyoffice /var/lib/onlyoffice /var/www/onlyoffice/Data /usr/share/fonts/truetype/custom
VOLUME
/etc/onlyoffice /var/log/onlyoffice /var/lib/onlyoffice /var/www/onlyoffice/Data
/var/lib/postgresql
/usr/share/fonts/truetype/custom
CMD
bash -C '/app/onlyoffice/run-document-server.sh';'bash'
CMD
bash -C '/app/onlyoffice/run-document-server.sh';'bash'
This diff is collapsed.
Click to expand it.
run-document-server.sh
+
31
−
1
View file @
2fd40861
...
@@ -33,6 +33,11 @@ JSON="json -q -f ${ONLYOFFICE_DEFAULT_CONFIG}"
...
@@ -33,6 +33,11 @@ JSON="json -q -f ${ONLYOFFICE_DEFAULT_CONFIG}"
LOCAL_SERVICES
=()
LOCAL_SERVICES
=()
PG_VERSION
=
9.3
PG_NAME
=
main
PGDATA
=
/var/lib/postgresql/
${
PG_VERSION
}
/
${
PG_NAME
}
PG_NEW_CLUSTER
=
false
read_setting
(){
read_setting
(){
POSTGRESQL_SERVER_HOST
=
${
POSTGRESQL_SERVER_HOST
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbHost
)
}
POSTGRESQL_SERVER_HOST
=
${
POSTGRESQL_SERVER_HOST
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbHost
)
}
POSTGRESQL_SERVER_PORT
=
${
POSTGRESQL_SERVER_PORT
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbPort
)
}
POSTGRESQL_SERVER_PORT
=
${
POSTGRESQL_SERVER_PORT
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbPort
)
}
...
@@ -127,7 +132,24 @@ update_redis_settings(){
...
@@ -127,7 +132,24 @@ update_redis_settings(){
${
JSON
}
-I
-e
"this.services.CoAuthoring.redis.port = '
${
REDIS_SERVER_PORT
}
'"
${
JSON
}
-I
-e
"this.services.CoAuthoring.redis.port = '
${
REDIS_SERVER_PORT
}
'"
}
}
create_postgresql_cluster
(){
local
pg_conf_dir
=
/etc/postgresql/
${
PG_VERSION
}
/
${
PG_NAME
}
local
postgresql_conf
=
$pg_conf_dir
/postgresql.conf
local
hba_conf
=
$pg_conf_dir
/pg_hba.conf
mv
$postgresql_conf
$postgresql_conf
.backup
mv
$hba_conf
$hba_conf
.backup
pg_createcluster
${
PG_VERSION
}
${
PG_NAME
}
}
create_postgresql_db
(){
create_postgresql_db
(){
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;"
}
create_postgresql_tbl
(){
CONNECTION_PARAMS
=
"-h
${
POSTGRESQL_SERVER_HOST
}
-U
${
POSTGRESQL_SERVER_USER
}
-w"
CONNECTION_PARAMS
=
"-h
${
POSTGRESQL_SERVER_HOST
}
-U
${
POSTGRESQL_SERVER_USER
}
-w"
if
[
-n
"
${
POSTGRESQL_SERVER_PASS
}
"
]
;
then
if
[
-n
"
${
POSTGRESQL_SERVER_PASS
}
"
]
;
then
export
PGPASSWORD
=
${
POSTGRESQL_SERVER_PASS
}
export
PGPASSWORD
=
${
POSTGRESQL_SERVER_PASS
}
...
@@ -209,8 +231,12 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then
...
@@ -209,8 +231,12 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then
if
[
${
POSTGRESQL_SERVER_HOST
}
!=
"localhost"
]
;
then
if
[
${
POSTGRESQL_SERVER_HOST
}
!=
"localhost"
]
;
then
update_postgresql_settings
update_postgresql_settings
waiting_for_postgresql
waiting_for_postgresql
create_postgresql_
db
create_postgresql_
tbl
else
else
if
[
!
-d
${
PGDATA
}
]
;
then
create_postgresql_cluster
PG_NEW_CLUSTER
=
true
fi
LOCAL_SERVICES+
=(
"postgresql"
)
LOCAL_SERVICES+
=(
"postgresql"
)
fi
fi
...
@@ -239,6 +265,10 @@ for i in ${LOCAL_SERVICES[@]}; do
...
@@ -239,6 +265,10 @@ for i in ${LOCAL_SERVICES[@]}; do
service
$i
start
service
$i
start
done
done
if
[
${
PG_NEW_CLUSTER
}
=
"true"
]
;
then
create_postgresql_tbl
fi
if
[
${
ONLYOFFICE_DATA_CONTAINER
}
!=
"true"
]
;
then
if
[
${
ONLYOFFICE_DATA_CONTAINER
}
!=
"true"
]
;
then
waiting_for_postgresql
waiting_for_postgresql
waiting_for_rabbitmq
waiting_for_rabbitmq
...
...
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