generated from coop-cloud/example
Compare commits
17 Commits
2.6.0+7.4.
...
kc_stable
| Author | SHA1 | Date | |
|---|---|---|---|
| 64a030b0db | |||
| bc5bf18b21 | |||
| 6c8b7dd2a7 | |||
|
04caca0798
|
|||
| 45d1f09317 | |||
| b571899521 | |||
| c1fa536df2 | |||
| 807b095441 | |||
| 5f3dcb4256 | |||
| 3022729f66 | |||
| 450c1cdca0 | |||
| bb99499b91 | |||
| b681d6ef44 | |||
| 928469f6eb | |||
| 3072d4c33c | |||
| c9ed2edd8f | |||
| 012b672e7a |
@ -19,6 +19,7 @@ steps:
|
||||
LETS_ENCRYPT_ENV: production
|
||||
ENTRYPOINT_VERSION: v1
|
||||
SECRET_DB_PASSWORD_VERSION: v1
|
||||
PG_BACKUP_VERSION: v2
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
@ -34,7 +35,7 @@ steps:
|
||||
from_secret: drone_abra-bot_token
|
||||
fork: true
|
||||
repositories:
|
||||
- coop-cloud/auto-recipes-catalogue-json
|
||||
- toolshed/auto-recipes-catalogue-json
|
||||
|
||||
trigger:
|
||||
event: tag
|
||||
|
||||
@ -2,6 +2,7 @@ TYPE=onlyoffice
|
||||
TIMEOUT=300
|
||||
ENABLE_AUTO_UPDATE=true
|
||||
LETS_ENCRYPT_ENV=production
|
||||
ENABLE_BACKUPS=true
|
||||
DOMAIN=onlyoffice.example.com
|
||||
|
||||
SECRET_DB_PASSWORD_VERSION=v1
|
||||
|
||||
@ -25,3 +25,8 @@
|
||||
|
||||
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech) and [`ONLYOFFICE/Docker-DocumentServer`](https://github.com/ONLYOFFICE/Docker-DocumentServer).
|
||||
[Official Onlyoffice docker compose](https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/master/docker-compose.yml)
|
||||
|
||||
## Add custom fonts
|
||||
Per default the config parameter for **GENERATE_FONT** is set to *true*, so fonts list and the fonts thumbnails are regenerated at each start. To add additional fonts you can copy them via abra to the volume `/usr/share/fonts/truetype` and restart the service:
|
||||
* `abra app cp 123.net calibri-regular.ttf app:/usr/share/fonts/truetype`
|
||||
* `abra app restart office.tmp.dev.local-it.cloud service app`
|
||||
|
||||
1
abra.sh
1
abra.sh
@ -1,4 +1,5 @@
|
||||
export ENTRYPOINT_VERSION=v1
|
||||
export PG_BACKUP_VERSION=v2
|
||||
|
||||
prepare_shutdown () {
|
||||
documentserver-prepare4shutdown.sh
|
||||
|
||||
6
alaconnect.yml
Normal file
6
alaconnect.yml
Normal file
@ -0,0 +1,6 @@
|
||||
nextcloud:
|
||||
uncomment:
|
||||
- compose.jwt.yml
|
||||
- SECRET_JWT_SECRET_VERSION
|
||||
shared_secrets:
|
||||
onlyoffice_jwt: jwt_secret
|
||||
39
compose.yml
39
compose.yml
@ -1,14 +1,14 @@
|
||||
version: '3.8'
|
||||
services:
|
||||
app:
|
||||
image: onlyoffice/documentserver:7.3.3
|
||||
image: onlyoffice/documentserver:9.0.2
|
||||
depends_on:
|
||||
- db
|
||||
- rabbitmq
|
||||
stdin_open: true
|
||||
networks:
|
||||
- proxy
|
||||
- internal
|
||||
- internal
|
||||
environment:
|
||||
DB_TYPE: postgres
|
||||
DB_HOST: db
|
||||
@ -17,13 +17,15 @@ services:
|
||||
DB_USER: onlyoffice
|
||||
DB_PWD_FILE: /run/secrets/db_password
|
||||
AMQP_URI: amqp://guest:guest@rabbitmq
|
||||
AUTO_ASSEMBLY_ENABLED:
|
||||
AUTO_ASSEMBLY_INTERVAL:
|
||||
AUTO_ASSEMBLY_STEP:
|
||||
AUTO_ASSEMBLY_ENABLED:
|
||||
AUTO_ASSEMBLY_INTERVAL:
|
||||
AUTO_ASSEMBLY_STEP:
|
||||
volumes:
|
||||
- fonts:/usr/share/fonts/truetype
|
||||
secrets:
|
||||
- db_password
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost/welcome"]
|
||||
test: [ "CMD", "curl", "-f", "http://localhost/welcome" ]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
@ -47,10 +49,10 @@ services:
|
||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-fwdproto"
|
||||
- "traefik.http.middlewares.${STACK_NAME}-fwdproto.headers.customRequestHeaders.X-Forwarded-Proto=https"
|
||||
- "coop-cloud.${STACK_NAME}.version=2.5.1+7.3.3"
|
||||
- "coop-cloud.${STACK_NAME}.version=2.11.1+9.0.2"
|
||||
|
||||
rabbitmq:
|
||||
image: rabbitmq:3.11.13
|
||||
image: rabbitmq:4.1.1
|
||||
networks:
|
||||
- internal
|
||||
healthcheck:
|
||||
@ -59,9 +61,15 @@ services:
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
start_period: 1m
|
||||
|
||||
|
||||
db:
|
||||
image: postgres:9.5
|
||||
deploy:
|
||||
labels:
|
||||
backupbot.backup: "${ENABLE_BACKUPS:-true}"
|
||||
backupbot.backup.pre-hook: "/pg_backup.sh backup"
|
||||
backupbot.backup.volumes.db.path: "backup.sql"
|
||||
backupbot.restore.post-hook: '/pg_backup.sh restore'
|
||||
environment:
|
||||
POSTGRES_DB: onlyoffice
|
||||
POSTGRES_USER: onlyoffice
|
||||
@ -73,20 +81,27 @@ services:
|
||||
networks:
|
||||
- internal
|
||||
healthcheck:
|
||||
test: ["CMD", "pg_isready"]
|
||||
test: [ "CMD", "pg_isready", "-U", "onlyoffice" ]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
start_period: 1m
|
||||
configs:
|
||||
- source: pg_backup
|
||||
target: /pg_backup.sh
|
||||
mode: 0555
|
||||
|
||||
volumes:
|
||||
db:
|
||||
fonts:
|
||||
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
internal:
|
||||
|
||||
|
||||
secrets:
|
||||
db_password:
|
||||
external: true
|
||||
@ -97,4 +112,6 @@ configs:
|
||||
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
|
||||
file: entrypoint.sh.tmpl
|
||||
template_driver: golang
|
||||
|
||||
pg_backup:
|
||||
name: ${STACK_NAME}_pg_backup_${PG_BACKUP_VERSION}
|
||||
file: pg_backup.sh
|
||||
|
||||
34
pg_backup.sh
Normal file
34
pg_backup.sh
Normal file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
BACKUP_FILE='/var/lib/postgresql/data/backup.sql'
|
||||
|
||||
function backup {
|
||||
export PGPASSWORD=$(cat /run/secrets/db_password)
|
||||
pg_dump -U ${POSTGRES_USER} ${POSTGRES_DB} > $BACKUP_FILE
|
||||
}
|
||||
|
||||
function restore {
|
||||
cd /var/lib/postgresql/data/
|
||||
restore_config(){
|
||||
# Restore allowed connections
|
||||
cat pg_hba.conf.bak > pg_hba.conf
|
||||
su postgres -c 'pg_ctl reload'
|
||||
}
|
||||
# Don't allow any other connections than local
|
||||
cp pg_hba.conf pg_hba.conf.bak
|
||||
echo "local all all trust" > pg_hba.conf
|
||||
su postgres -c 'pg_ctl reload'
|
||||
trap restore_config EXIT INT TERM
|
||||
|
||||
# Recreate Database
|
||||
psql -U ${POSTGRES_USER} -d postgres -c "DROP DATABASE ${POSTGRES_DB} WITH (FORCE);"
|
||||
createdb -U ${POSTGRES_USER} ${POSTGRES_DB}
|
||||
psql -U ${POSTGRES_USER} -d ${POSTGRES_DB} -1 -f $BACKUP_FILE
|
||||
|
||||
trap - EXIT INT TERM
|
||||
restore_config
|
||||
}
|
||||
|
||||
$@
|
||||
2
release/2.11.1+9.0.2
Normal file
2
release/2.11.1+9.0.2
Normal file
@ -0,0 +1,2 @@
|
||||
This patch upgrade adds a fonts volume
|
||||
Custom fonts can be copied there as described in the readme
|
||||
Reference in New Issue
Block a user