-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨Preview generation as a separate node instance
- Loading branch information
Showing
6 changed files
with
189 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
tdrive/backend/node/src/services/previews/services/files/engine/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import { Initializable } from "../../../../../core/platform/framework"; | ||
import { ClearProcessor } from "./clear"; | ||
import { PreviewProcessor } from "./service"; | ||
import gr from "../../../../global-resolver"; | ||
import { Processor } from "src/core/platform/services/message-queue/processor"; | ||
|
||
/** | ||
* The notification engine is in charge of processing data and delivering user notifications on the right place | ||
*/ | ||
export class PreviewEngine implements Initializable { | ||
constructor(readonly processor: Processor) {} | ||
|
||
async init(): Promise<this> { | ||
gr.platformServices.messageQueue.processor.addHandler(new PreviewProcessor()); | ||
gr.platformServices.messageQueue.processor.addHandler(new ClearProcessor()); | ||
this.processor.addHandler(new PreviewProcessor()); | ||
this.processor.addHandler(new ClearProcessor()); | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
version: "3.4" | ||
|
||
services: | ||
mongo: | ||
container_name: mongo | ||
image: mongo | ||
volumes: | ||
- ./docker-data/mongo:/data/db | ||
ports: | ||
- 27017:27017 | ||
networks: | ||
- tdrive_network | ||
|
||
node: | ||
build: | ||
context: . | ||
dockerfile: docker/tdrive-node/Dockerfile | ||
target: development | ||
container_name: tdrive-node | ||
hostname: tdrive_node | ||
ports: | ||
- 4000:4000 | ||
- 9229:9229 | ||
environment: | ||
- DEV=dev | ||
- SEARCH_DRIVER=mongodb | ||
- DB_DRIVER=mongodb | ||
- PUBSUB_TYPE=amqp | ||
- SERVICES_LIST=[ "webserver", "database", "tracker", "applications", "search", "storage", "message-queue", "user", "files", "auth", "documents", "counter", "cron", "general", "email-pusher" ] | ||
- ./docker-data/documents/:/storage/ | ||
volumes: | ||
- ./backend/node/profiles:/usr/src/app/profiles | ||
- ./backend/node/src:/usr/src/app/src | ||
- ./docker-data/documents/:/storage/ | ||
depends_on: | ||
- mongo | ||
links: | ||
- mongo | ||
networks: | ||
- tdrive_network | ||
|
||
node_preview: | ||
build: | ||
context: . | ||
dockerfile: docker/tdrive-node/Dockerfile | ||
target: development | ||
container_name: tdrive-preview-node | ||
hostname: tdrive_preview_node | ||
ports: | ||
- 4001:4001 | ||
- 9229:9229 | ||
environment: | ||
- DEV=dev | ||
- TWAKE_DRIVE_PORT="4001" | ||
- SEARCH_DRIVER=mongodb | ||
- DB_DRIVER=mongodb | ||
- PUBSUB_TYPE=amqp | ||
- SERVICES_LIST=[ "webserver", "previews", "database", "tracker", "applications", "search", "storage", "message-queue", "user", "files", "auth", "documents", "counter", "cron", "general", "email-pusher" ] | ||
- ./docker-data/documents/:/storage/ | ||
volumes: | ||
- ./backend/node/profiles:/usr/src/app/profiles | ||
- ./backend/node/src:/usr/src/app/src | ||
- ./docker-data/documents/:/storage/ | ||
depends_on: | ||
- mongo | ||
links: | ||
- mongo | ||
networks: | ||
- tdrive_network | ||
|
||
frontend: | ||
build: | ||
context: . | ||
dockerfile: docker/tdrive-frontend/Dockerfile | ||
container_name: tdrive_frontend | ||
environment: | ||
- DEV=production | ||
- SSL_CERTS=selfsigned | ||
- NODE_HOST=http://tdrive_node:4000 | ||
ports: | ||
- 80:80 | ||
- 443:443 | ||
depends_on: | ||
- node | ||
volumes: | ||
- ./docker-data/logs/nginx/:/var/log/nginx | ||
- ./docker-data/letsencrypt/:/etc/letsencrypt/ | ||
- ./docker-data/drive-preview/:/tdrive-core/web/medias/ | ||
- ./docker-data/uploads/:/tdrive-core/web/upload/ | ||
- ./docker-data/ssl:/etc/nginx/ssl | ||
networks: | ||
- tdrive_network | ||
|
||
onlyoffice-connector: | ||
build: | ||
context: . | ||
dockerfile: docker/onlyoffice-connector/Dockerfile | ||
environment: | ||
- CREDENTIALS_ENDPOINT=http://tdrive_node:4000 | ||
- ONLY_OFFICE_SERVER=http://onlyoffice:8090/ | ||
- SERVER_ORIGIN=http://onlyoffice-connector:5000 | ||
- SERVER_PORT=5000 | ||
- SERVER_PREFIX=/plugins/onlyoffice | ||
- CREDENTIALS_ID=tdrive_onlyoffice | ||
- CREDENTIALS_SECRET=c1cc66db78e1d3bb4713c55d5ab2 | ||
ports: | ||
- 5000:5000 | ||
depends_on: | ||
- onlyoffice | ||
networks: | ||
- tdrive_network | ||
|
||
onlyoffice-rabbitmq: | ||
image: rabbitmq:management | ||
hostname: onlyoffice-rabbitmq | ||
container_name: rabbitmq | ||
environment: | ||
- RABBITMQ_DEFAULT_USER=guest | ||
- RABBITMQ_DEFAULT_PASS=guest | ||
ports: | ||
- "5672:5672" | ||
- "15672:15672" | ||
volumes: | ||
- ./.docker-conf/rabbitmq/data/:/var/lib/rabbitmq/ | ||
- ./.docker-conf/rabbitmq/log/:/var/log/rabbitmq | ||
networks: | ||
- tdrive_network | ||
|
||
onlyoffice-postgresql: | ||
image: postgres:13 | ||
hostname: onlyoffice-postgresql | ||
environment: | ||
- POSTGRES_DB=onlyoffice | ||
- POSTGRES_USER=onlyoffice | ||
- POSTGRES_PASSWORD=onlyoffice | ||
ports: | ||
- 5432:5432 | ||
volumes: | ||
- ./onlyoffice_postgres_data:/var/lib/postgresql/data | ||
networks: | ||
- tdrive_network | ||
|
||
onlyoffice: | ||
image: docker.io/onlyoffice/documentserver | ||
ports: | ||
- 8090:80 | ||
networks: | ||
- tdrive_network | ||
environment: | ||
- AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq | ||
- DB_HOST=onlyoffice-postgresql | ||
- DB_NAME=onlyoffice | ||
- DB_PORT=5432 | ||
- DB_TYPE=postgres | ||
- DB_USER=onlyoffice | ||
- JWT_ENABLED=false | ||
depends_on: | ||
- onlyoffice-rabbitmq | ||
- onlyoffice-postgresql | ||
volumes: | ||
- ./onlyoffice_data:/var/www/onlyoffice/Data | ||
|
||
networks: | ||
tdrive_network: | ||
driver: bridge | ||
|