Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8S, Need a bare-bones Dockerfile for ONLYOFFICE - no bundled services, just the core, any help? #773

Open
gowy222 opened this issue Sep 15, 2024 · 4 comments
Assignees
Labels
question Issues that look for answers

Comments

@gowy222
Copy link

gowy222 commented Sep 15, 2024

Hey ONLYOFFICE team,
I'm trying to deploy ONLYOFFICE in a Kubernetes environment, and current Dockerfile is overkill. It's packing a bunch of services I don't need.

Potential improvement to consider:
A Dockerfile that builds ONLY the ONLYOFFICE core
No bundled database services (PostgreSQL, MySQL)
No bundled message queue (RabbitMQ)
No bundled cache (Redis)
No bundled web server (Nginx)

Why?
using external cloud services for all of the above
K8S handles load balancing, so no need for Nginx
Current Dockerfile is too heavy and inflexible for K8S deployments

The ideal Dockerfile would:
Build core ONLYOFFICE components
Include only necessary DB client libs (for PostgreSQL/MySQL)
Skip all other service installations

This would make ONLYOFFICE way more flexible for cloud-native deployments.
Simplified maintenance and updates
easily connect it to any external services.

Thanks for considering this! It would be a huge help for K8S users.

@gowy222 gowy222 changed the title Need a bare-bones Dockerfile for ONLYOFFICE - no bundled services, just the core, any help? K8S, Need a bare-bones Dockerfile for ONLYOFFICE - no bundled services, just the core, any help? Sep 15, 2024
@igwyd
Copy link
Member

igwyd commented Sep 16, 2024

Hello @gowy222, i think you looking for this repository https://github.com/ONLYOFFICE/Kubernetes-Docs and the images form here https://github.com/ONLYOFFICE/Docker-Docs.

@Rita-Bubnova Rita-Bubnova added the waiting feedback Issues that we waiting to be answered from author of issue label Sep 16, 2024
@gowy222
Copy link
Author

gowy222 commented Sep 17, 2024

Hello @gowy222, i think you looking for this repository https://github.com/ONLYOFFICE/Kubernetes-Docs and the images form here https://github.com/ONLYOFFICE/Docker-Docs.

First of all, thank you very much.
I studied https://github.com/ONLYOFFICE/Docker-Docs/blob/master/Dockerfile.noplugins, but I am still confused

  1. As for the basic ds-service, what is the purpose of rpm2cpio? Python:2.7 is also required to install redis. If a third-party cloud redis is used, can this step be ignored? Secondly, nginx seems to be forced to be built-in. Considering the external third-party gateway load balancing and the later migration of rust gateway (such as Pingora), is there a chance to isolate the nginx layer independently, so that it is convenient to customize the use of other load balancing and proxy gateways later? The biggest difficulty at present is https://github.com/ONLYOFFICE/Docker-Docs/blob/master/proxy-docker-entrypoint.sh and https://github.com/ONLYOFFICE/Docker-Docs/blob/master/docker-entrypoint.sh. These two need to be fully understood and related before secondary customization

  2. Regarding fonts, documentserver-generate-allfonts.sh true, I prefer to use dockerfile to build fonts in multiple stages independently, and then copy fonts between stages, especially Chinese fonts, and open source finished fonts can be copied between them. I hope to reduce the size of docker images

  3. The rest of the research is not clear yet.. It needs to be studied continuously, and it is a little complicated overall

  4. It seems that there is no way to build completely independently and modularly at present. Each stage is closely related to each other. One wrong step may cause the rest to not work

  5. Of course, if there is a chance, I hope to use ubuntu/debian to build, amazonlinux:2 is not very familiar

the end:
I have an idea, for example, the onlyoffice service is independent, simplified, and not bound to anything.

Then the second independent image is used as a gateway entry and launcher to start and configure the onlyoffice service and document conversion service, how to start, how to connect to the corresponding database, etc.

This has an advantage, no matter how the onlyoffice version is updated, this is independent and deployed separately. Therefore, there is no need to come back to study whether the sh script is adapted every time a cross-version update is made.

@igwyd
Copy link
Member

igwyd commented Sep 17, 2024

Python:2.7 is also required to install redis. If a third-party cloud redis is used, can this step be ignored?

yes, you can ignore it because it was added for other k8s distribution - https://github.com/ONLYOFFICE/Kubernetes-Docs-Shards

Secondly, nginx seems to be forced to be built-in

nginx is separated container, builds as proxy

Regarding fonts

For adding your fonts - guide is here https://github.com/ONLYOFFICE/Docker-Docs?tab=readme-ov-file#building-onlyoffice-docs

Of course, if there is a chance, I hope to use ubuntu/debian to build, amazonlinux:2 is not very familiar

It's because we use RPM here

About the rest - i have forwarded your comments to the developers.

@Rita-Bubnova Rita-Bubnova added the question Issues that look for answers label Sep 17, 2024
@gowy222
Copy link
Author

gowy222 commented Sep 18, 2024

@igwyd

HI,
I've been analyzing the dockerfile
https://github.com/ONLYOFFICE/Docker-Docs/blob/master/Dockerfile.noplugins
and still have a few questions and challenges that I'd like your assistance with.

I have retained the key stages:

ds-base
ds-service
docservice
converter
proxy

I have removed the non-essential stages:

redis-lib
builder
utils
metrics
db
example

After these changes, I have a few questions:

  1. Including Client Libraries for External Services:
    In the original Dockerfile, client libraries for Redis and databases (e.g., redis, psycopg2, PyMySQL, pika) are installed in separate stages (redis-lib, builder, utils) and then copied into the service stages.
    Since I have removed these stages, I understand that I need to install these client libraries elsewhere to ensure that docservice and converter can connect to external services.
    Question: Where and how should I install the necessary client libraries in the slimmed-down Dockerfile? What is the recommended way to include them to ensure proper functionality?

  2. Purpose of builder and utils Stages:
    The builder stage installs various Python client libraries, and its outputs are used in the utils stage. However, the utils stage is not referenced in subsequent stages.
    Are the builder and utils stages necessary for the core functionality of ONLYOFFICE Document Server, or can they be safely removed without impacting essential services?

Any insights or assistance on these points would be greatly appreciated.
Thank you again.

@Rita-Bubnova Rita-Bubnova removed the waiting feedback Issues that we waiting to be answered from author of issue label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that look for answers
Projects
None yet
Development

No branches or pull requests

3 participants