Skip to content
Snippets Groups Projects
Commit f80475cb authored by drebs's avatar drebs
Browse files

Run ONLYOFFICE DocumentServer with docker-compose (#787)

parent 5d815d5f
No related branches found
No related tags found
No related merge requests found
Pipeline #55674 failed
# Install Docker
class profile::docker {
include docker
include docker::compose
}
# An ONLYOFFICE installation based on Docker
class profile::onlyoffice (
String $image_tag = 'latest',
String $jwt_secret = '',
Boolean $skip_fonts_generation = false,
) {
$network = 'onlyoffice'
docker_network { $network:
ensure => present,
subnet => '172.19.0.0/24',
gateway => '172.19.0.1',
ip_range => '172.19.0.0/29',
}
docker::run { 'onlyoffice-documentserver':
image => "infrarednetwork/onlyoffice-documentserver:${image_tag}",
net => $network,
env => [
'RABBITMQ_SERVER_URL=amqp://guest:guest@onlyoffice-rabbitmq',
'REDIS_SERVER_HOST=onlyoffice-redis',
'REDIS_SERVER_PORT=6379',
'POSTGRESQL_SERVER_HOST=onlyoffice-postgresql',
'POSTGRESQL_SERVER_PORT=5432',
'POSTGRESQL_SERVER_DB_NAME=onlyoffice',
'POSTGRESQL_SERVER_USER=onlyoffice',
'POSTGRESQL_SERVER_PASS=onlyoffice',
"JWT_SECRET=${jwt_secret}",
"SKIP_FONTS_GENERATION=${skip_fonts_generation}",
],
ports => [
'8000:8000',
'8080:8080',
],
depends => [
'onlyoffice-postgresql',
'onlyoffice-redis',
'onlyoffice-rabbitmq',
],
volumes => [
'onlyoffice-log:/var/log/onlyoffice',
'onlyoffice-www-data:/var/www/onlyoffice/Data',
'onlyoffice-lib:/var/lib/onlyoffice',
'system-custom-fonts:/usr/share/fonts/truetype/custom',
],
require => [
Docker::Run['onlyoffice-redis'],
Docker::Run['onlyoffice-rabbitmq'],
Docker::Run['onlyoffice-postgresql'],
],
}
docker::run { 'onlyoffice-redis':
image => 'redis:alpine',
net => $network,
command => 'redis-server --appendonly yes',
expose => '6379',
volumes => [ 'redis-data:/data' ],
}
docker::run { 'onlyoffice-rabbitmq':
image => 'rabbitmq:alpine',
net => $network,
expose => '5672',
volumes => [ 'rabbitmq-home:/var/lib/rabbitmq' ],
}
docker::run { 'onlyoffice-postgresql':
image => 'postgres',
net => $network,
env => [
'POSTGRES_DB=onlyoffice',
'POSTGRES_USER=onlyoffice',
'POSTGRES_PASSWORD=onlyoffice',
],
expose => '5432',
volumes => [ 'postgresql-data:/var/lib/postgresql/data' ],
}
}
# Install OnlyOffice
class role::onlyoffice {
include profile::docker
include profile::onlyoffice
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment