mediacms-io / mediacms

MediaCMS is a modern, fully featured open source video and media CMS, written in Python/Django and React, featuring a REST API.
https://mediacms.io
GNU Affero General Public License v3.0
2.7k stars 498 forks source link

[Feature] Provide more deployment options #8

Closed mgogoulos closed 1 year ago

mgogoulos commented 3 years ago

Deployment through the installation script is possible since the project has been released. However a list of other options should be facilitated.

gharsallahmoez commented 3 years ago

@mgogoulos could you please tell us when the docker-compose deployment will be ready ?

mgogoulos commented 3 years ago

Hello @gharsallahmoez , docker-compose deployment should be ready until February 2021, unless of course there's someone form the community helping out to bring this earlier!

gharsallahmoez commented 3 years ago

@mgogoulos could you please provide manual steps install of mediacms? because install.sh runs multiple systemd services and Docker is designed around the idea of a single service/process per container.

mgogoulos commented 3 years ago

Sure, over the next few days I can prepare a wiki page documenting a few things that will facilitate the Dockerization of MediaCMS

swiftugandan commented 3 years ago

I am in the process of creating a docker-compose file based on the design below: This design should act as a basis for a scaleable deployment in docker, kubernetes or docker swarm.

For this to work correctly, we shall need to remove any SSL setup within the 'built-in' nginx server, and delegate it to an ingress reverse proxy.

What are your thoughts around dropping SSL setup, and instead delegating it to a reverse proxy?

    +---------------------------------------------------------------+                         
    |                                                               |                         
    |                             Clients                           |                         
    |                                                               |                         
    |                                                               |                         
    +--------------------------------^------------------------------+                         
                                     |                                                        
                        +------------|-----------+                                            
                        |  nginx reverse proxy   |                                            
                        |  (ssl termination,     |                                            
                        |  letsencrypt client)   |                                            
                        +------------|-----------+                                            
                                     |                                                        
    +--------------------------------v------------------------------+    +---------------+    
    |                                                               |    |               |    
    |                     mediacms_web                              |    |               |    
    |                     (1 or many instances)                     ------               |    
    |                                                               |    |               |    
    +-----|--------------------------------------------|------------+    |               |    
          |   +--------------+                         |                 |               |    
          |   |  celery_beat |           +-------------|------------+    |               |    
          |   |  (singleton  -------------                          |    |               |    
          |   |  instance)   |           |       redis              |    |File store     |    
          |   +--------------+           |       (singleton         |    |(static_store, |    
          |   +--------------+           |       instance)          |    |media_store    |    
          |   |  migrations  -------------                          |    |postgres_data) |    
          |   |  (run-once?) |           +-------------|------------+    |               |    
          |   +-------|------+                         |                 |               |    
          |           |    +---------------------------|------------+    |               |    
          |           |    |                                        |    |               |    
          |           |    |   celery_worker                        |    |               |    
          |           |    |   [celery_short, celery_long]          ------               |    
          |           |    |   (1 or many instances)                |    |               |    
          |           |    +-------------------|--------------------+    |               |    
          |           |                        |                         |               |    
    +-----|-----------|------------------------|--------------------+    |               |    
    |                                                               |    |               |    
    |                      postgres database                        ------               |    
    |                      (singleton instance)                     |    |               |    
    |                                                               |    |               |    
    +---------------------------------------------------------------+    +---------------+    
mgogoulos commented 3 years ago

Hello @swiftugandan, your diagram and suggestions look fantastic! Really hope you get an initial version of it so we can give it a try.

Trying to containerize what now runs as systemd processes, should produce the following container types:

a) mediacms_web (one or more) b) postgres c) celery_beat d) celery_short (one or more) e) celery_long (one or more) f) redis g) nginx

Containers related to the Django application (a, c, d, e) should have access to the code, for being able to set different settings on cms/settings.py or cmc/local_settings.py and for being able to update the code. Also the following data need be available (for easy copy/backup)

Initial steps, run once at installation are:

inclusion of ffmpeg is needed for all Containers that are related to Django, while inclusion of Bento4 utility need be for celery_long only.

If you stumble on anything strange on the installation script https://github.com/mediacms-io/mediacms/blob/main/install.sh or inside directory deploy/ that contains the systemd configurations, I can provide insights.

Thanks!

mgogoulos commented 3 years ago

Docker and docker-compose support is now part of MediaCMS, thanks to the work of @swiftugandan !