mediacms icon indicating copy to clipboard operation
mediacms copied to clipboard

[Feature] Provide more deployment options

Open mgogoulos opened this issue 3 years ago • 7 comments

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

  • [x] Docker Compose
  • [ ] Deploying to Heroku
  • [ ] Deploying to Digital Ocean/AWS/Azure/GCP
  • [ ] Deploying to Cloudron

mgogoulos avatar Dec 31 '20 10:12 mgogoulos

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

gharsallahmoez avatar Jan 06 '21 10:01 gharsallahmoez

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!

mgogoulos avatar Jan 07 '21 21:01 mgogoulos

@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.

gharsallahmoez avatar Jan 08 '21 08:01 gharsallahmoez

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

mgogoulos avatar Jan 10 '21 08:01 mgogoulos

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)                     |    |               |    
    |                                                               |    |               |    
    +---------------------------------------------------------------+    +---------------+    

swiftugandan avatar Jan 19 '21 14:01 swiftugandan

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)

  • directory for media content (/media_files)
  • static files (/static)
  • postgresql data
  • the source code

Initial steps, run once at installation are:

  • database creation
  • Django migrations
  • Django fixtures load
  • creation of Django SECRET_KEY
  • admin user creation
  • run collectstatic to collect content to /static (this should be served by nginx)

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 avatar Jan 19 '21 17:01 mgogoulos

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

mgogoulos avatar Feb 02 '21 20:02 mgogoulos