mirror of
https://github.com/ONLYOFFICE/Docker-DocumentServer.git
synced 2026-02-10 20:45:40 +08:00
Add damengdb stand (#712)
* Add dameng stand * Rename compose file * Move damengdb files in tests folder * Remove copy bin disql command * Refactoring damengdb stand * Update readme instructions * Refactor: update readme * Refactor: add note * Update run command for disql copy * Remove scripts and add volumes in compose file Stand was updated. Main changes that scripts for prepare environment was removed.Now damengdb image can be pulled from hub.docker, also disql will be mounted from damengdb container in documentserver container. * Update damengdb image version * Actualized damengdb compose file Use damengdb image from onlyoffice repo. Also do not use develop documentserver build anymore * Don't mount entrypoint script anymore After release it will be inside the image with the necessary edits * Add the ability to build an image before compose is started * Dameng: Execute schema on build stage Now if you want use damengdb, you nedd build own image, schema for Documentserver will be create on build stage. Add dockerfile for the build dameng image. Also disql bin file don't share between containers * Actualize readme for damengdb stand * Editing typos * Remove useless lines * Small cosmetic change * Remove useless volume from compose file * Use default password for check connection * Remove `image` filed from compose
This commit is contained in:
1
tests/damengdb/.env
Normal file
1
tests/damengdb/.env
Normal file
@ -0,0 +1 @@
|
||||
VERSION=latest
|
||||
19
tests/damengdb/README.md
Normal file
19
tests/damengdb/README.md
Normal file
@ -0,0 +1,19 @@
|
||||
## Stand Documentserver with damengdb
|
||||
|
||||
### How it works
|
||||
|
||||
For deploy stand, you need:
|
||||
|
||||
**STEP 1**: Build you own images, do it with command:
|
||||
|
||||
```bash
|
||||
docker compose build
|
||||
```
|
||||
|
||||
**STEP 2**: Wait build and when it finish deploy with command:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
Thats all.
|
||||
46
tests/damengdb/damengdb.Dockerfile
Normal file
46
tests/damengdb/damengdb.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM onlyoffice/damengdb:8.1.2 as damengdb
|
||||
|
||||
ARG DM8_USER="SYSDBA"
|
||||
ARG DM8_PASS="SYSDBA001"
|
||||
ARG DB_HOST="localhost"
|
||||
ARG DB_PORT="5236"
|
||||
ARG DISQL_BIN="/opt/dmdbms/bin"
|
||||
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
COPY <<"EOF" /wait_dm_ready.sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function wait_dm_ready() {
|
||||
cd /opt/dmdbms/bin
|
||||
for i in `seq 1 10`; do
|
||||
echo `./disql /nolog <<EOF
|
||||
CONN SYSDBA/SYSDBA001@localhost
|
||||
exit
|
||||
EOF` | grep "connection failure" > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "DM Database is not OK, please wait..."
|
||||
sleep 10
|
||||
else
|
||||
echo "DM Database is OK"
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
wait_dm_ready
|
||||
|
||||
EOF
|
||||
|
||||
|
||||
RUN bash /opt/startup.sh > /dev/null 2>&1 \
|
||||
& mkdir -p /schema/damengdb \
|
||||
&& apt update -y ; apt install wget -y \
|
||||
&& wget https://raw.githubusercontent.com/ONLYOFFICE/server/master/schema/dameng/createdb.sql -P /schema/dameng/ \
|
||||
&& bash ./wait_dm_ready.sh \
|
||||
&& cd ${DISQL_BIN} \
|
||||
&& ./disql $DM8_USER/$DM8_PASS@$DB_HOST:$DB_PORT -e \
|
||||
"create user "onlyoffice" identified by "onlyoffice" password_policy 0;" \
|
||||
&& echo "EXIT" | tee -a /schema/dameng/createdb.sql \
|
||||
&& ./disql $DM8_USER/$DM8_PASS@$DB_HOST:$DB_PORT \`/schema/dameng/createdb.sql \
|
||||
&& sleep 10
|
||||
67
tests/damengdb/docker-compose.yml
Normal file
67
tests/damengdb/docker-compose.yml
Normal file
@ -0,0 +1,67 @@
|
||||
version: '2'
|
||||
services:
|
||||
onlyoffice-documentserver:
|
||||
build:
|
||||
context: ../../.
|
||||
dockerfile: Dockerfile
|
||||
target: documentserver
|
||||
container_name: onlyoffice-documentserver
|
||||
depends_on:
|
||||
- onlyoffice-dameng
|
||||
- onlyoffice-rabbitmq
|
||||
environment:
|
||||
- DB_TYPE=dameng
|
||||
- DB_HOST=onlyoffice-dameng
|
||||
- DB_PORT=5236
|
||||
- DB_NAME=onlyoffice
|
||||
- DB_USER=onlyoffice
|
||||
- AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq
|
||||
# Costomize the JSON Web Token validation parameters if needed.
|
||||
#- JWT_ENABLED=false
|
||||
#- JWT_SECRET=secret
|
||||
#- JWT_HEADER=Authorization
|
||||
#- JWT_IN_BODY=true
|
||||
ports:
|
||||
- '80:80'
|
||||
- '443:443'
|
||||
stdin_open: true
|
||||
restart: always
|
||||
stop_grace_period: 60s
|
||||
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-rabbitmq:
|
||||
container_name: onlyoffice-rabbitmq
|
||||
image: rabbitmq
|
||||
restart: always
|
||||
expose:
|
||||
- '5672'
|
||||
|
||||
onlyoffice-dameng:
|
||||
container_name: onlyoffice-dameng
|
||||
build:
|
||||
context: .
|
||||
dockerfile: damengdb.Dockerfile
|
||||
target: damengdb
|
||||
args:
|
||||
DM8_USER: SYSDBA
|
||||
DM8_PASS: SYSDBA001
|
||||
DB_HOST: localhost
|
||||
DB_PORT: 5236
|
||||
environment:
|
||||
- PAGE_SIZE=16
|
||||
- LD_LIBRARY_PATH=/opt/dmdbms/bin
|
||||
- INSTANCE_NAME=dm8_01
|
||||
restart: always
|
||||
expose:
|
||||
- '5236'
|
||||
volumes:
|
||||
- dameng_data:/opt/dmdbms/data
|
||||
|
||||
volumes:
|
||||
dameng_data:
|
||||
|
||||
Reference in New Issue
Block a user