Add ORACLE support (#734)

This commit is contained in:
Roman Demidov
2024-05-27 13:57:11 +03:00
committed by GitHub
parent b4e29f9695
commit bbfc86a1e0
8 changed files with 171 additions and 1 deletions

17
tests/oracle/README.md Normal file
View File

@ -0,0 +1,17 @@
## Stand Documentserver with oracle
### How it works
For deploy stand:
**STEP 1**: Build you own images:
```bash
sudo docker-compose build
```
**STEP 2**: Wait build complete and when:
```bash
sudo docker-compose up -d
```

28
tests/oracle/create_db_user.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
CONNECTION_STR="sqlplus sys/$ORACLE_PASSWORD@//localhost:1521/$ORACLE_DATABASE as sysdba"
export ORACLE_PWD=$ORACLE_PASSWORD
#start db
/opt/oracle/runOracle.sh &
#wait for db up
for (( i=1; i <= 20; i++ )); do
RES=$(echo "SELECT version FROM V\$INSTANCE;" | $CONNECTION_STR 2>/dev/null | grep "Connected" | wc -l)
if [ "$RES" -ne "0" ]; then
echo "Database is ready"
break
fi
sleep 10
done
sleep 1
#create new db user
$CONNECTION_STR <<EOF
CREATE USER $ORACLE_USER IDENTIFIED BY $ORACLE_PASSWORD;
GRANT CREATE SESSION TO $ORACLE_USER;
GRANT CREATE TABLE TO $ORACLE_USER;
ALTER USER $ORACLE_USER quota unlimited on USERS;
EOF

View File

@ -0,0 +1,38 @@
version: '2.1'
services:
onlyoffice-documentserver:
container_name: onlyoffice-documentserver
build:
context: ../../.
dockerfile: Dockerfile
depends_on:
- onlyoffice-oracle
environment:
- DB_TYPE=${DB_TYPE:-oracle}
- DB_HOST=${DB_HOST:-onlyoffice-oracle}
- DB_PORT=${DB_PORT:-1521}
- DB_NAME=${DB_NAME:-xepdb1}
- DB_USER=${DB_USER:-onlyoffice}
- DB_PWD=${DB_PWD:-onlyoffice}
stdin_open: true
restart: always
ports:
- '80:80'
onlyoffice-oracle:
container_name: onlyoffice-oracle
build:
context: .
dockerfile: oracle.Dockerfile
args:
- ORACLE_DATABASE=${DB_NAME:-xepdb1}
- ORACLE_USER=${DB_USER:-onlyoffice}
- ORACLE_PASSWORD=${DB_PWD:-onlyoffice}
restart: always
volumes:
- oracle_data:/opt/oracle/oradata
expose:
- '1521'
volumes:
oracle_data:

View File

@ -0,0 +1,15 @@
FROM container-registry.oracle.com/database/express:21.3.0-xe as onlyoffice-oracle
ARG ORACLE_DATABASE=
ARG ORACLE_PASSWORD=
ARG ORACLE_USER=
ENV ORACLE_DATABASE=$ORACLE_DATABASE \
ORACLE_PASSWORD=$ORACLE_PASSWORD \
ORACLE_USER=$ORACLE_USER
SHELL ["/bin/bash", "-c"]
COPY create_db_user.sh /tmp/create_db_user.sh
RUN bash /tmp/create_db_user.sh